kernel: mtdsplit_uimage: fix rootfs offset
The return value of the find_header function need to be added to the uimage_size, otherwise mtd_find_rootfs_from() might search for a rootfs within a custom header and fails. Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
parent
6391af2f1f
commit
35073d47bb
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ static int __mtdsplit_parse_uimage(struct mtd_info *master,
|
|||
}
|
||||
header = (struct uimage_header *)(buf + ret);
|
||||
|
||||
uimage_size = sizeof(*header) + be32_to_cpu(header->ih_size);
|
||||
uimage_size = sizeof(*header) + be32_to_cpu(header->ih_size) + ret;
|
||||
if ((offset + uimage_size) > master->size) {
|
||||
pr_debug("uImage exceeds MTD device \"%s\"\n",
|
||||
master->name);
|
||||
|
|
Loading…
Reference in a new issue