@ -33,7 +33,7 @@ static int mtdsplit_parse_seama(struct mtd_info *master,
struct mtd_part_parser_data * data )
{
struct seama_header hdr ;
size_t hdr_len , retlen , kernel_size ;
size_t hdr_len , retlen , kernel_ent_ size ;
size_t rootfs_offset ;
struct mtd_partition * parts ;
int err ;
@ -50,18 +50,20 @@ static int mtdsplit_parse_seama(struct mtd_info *master,
if ( be32_to_cpu ( hdr . magic ) ! = SEAMA_MAGIC )
return - EINVAL ;
kernel_size = hdr_len + be32_to_cpu ( hdr . size ) +
kernel_ent_ size = hdr_len + be32_to_cpu ( hdr . size ) +
be16_to_cpu ( hdr . metasize ) ;
if ( kernel_size > master - > size )
if ( kernel_ent_ size > master - > size )
return - EINVAL ;
/* Find the rootfs after the kernel. */
err = mtd_check_rootfs_magic ( master , kernel_size ) ;
/* Check for the rootfs right after Seama entity with a kernel. */
err = mtd_check_rootfs_magic ( master , kernel_ent_ size ) ;
if ( ! err ) {
rootfs_offset = kernel_size ;
rootfs_offset = kernel_ent_ size ;
} else {
/*
* The size in the header might cover the rootfs as well .
* On some devices firmware entity might contain both : kernel
* and rootfs . We can ' t determine kernel size so we just have to
* look for rootfs magic .
* Start the search from an arbitrary offset .
*/
err = mtd_find_rootfs_from ( master , SEAMA_MIN_ROOTFS_OFFS ,