aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2016-10-02 19:18:56 +0200
committerMathias Kresin <dev@kresin.me>2016-10-15 09:01:45 +0200
commit35073d47bb91fc0066a08c85c9206a6338a19b7e (patch)
tree0db598bdb28df0a6de5c6443cdef337d052aff25 /target/linux
parent6391af2f1fd451fcd3e4169dd1d7aa7fbe53fbda (diff)
downloadupstream-35073d47bb91fc0066a08c85c9206a6338a19b7e.tar.gz
upstream-35073d47bb91fc0066a08c85c9206a6338a19b7e.tar.bz2
upstream-35073d47bb91fc0066a08c85c9206a6338a19b7e.zip
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>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
index a50735a901..3ddb71bfa7 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_uimage.c
@@ -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);