summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-01-28 10:36:52 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-01-28 22:24:54 +0100
commit12ba8f8ce29fdd277f3100052eddc1afd2f5ea3f (patch)
treee2f27cdc5f96a07caa981d7e835982dd632f8adb /drivers/mtd
parentmtd: phram: use div_u64_rem to stop overwrite len in phram_setup (diff)
downloadlinux-12ba8f8ce29fdd277f3100052eddc1afd2f5ea3f.tar.xz
linux-12ba8f8ce29fdd277f3100052eddc1afd2f5ea3f.zip
mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()
If the kstrtouint() calls fail, then this should return a negative error code but it currently returns success. Fixes: dd84cb022b31 ("mtd: bcm63xxpart: move imagetag parsing to its own parser") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/YBKFtNaFHGYBj+u4@mwanda
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/parsers/parser_imagetag.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/parsers/parser_imagetag.c b/drivers/mtd/parsers/parser_imagetag.c
index d69607b48227..fab0949aabba 100644
--- a/drivers/mtd/parsers/parser_imagetag.c
+++ b/drivers/mtd/parsers/parser_imagetag.c
@@ -83,6 +83,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid rootfs address: %*ph\n",
(int)sizeof(buf->flash_image_start),
buf->flash_image_start);
+ ret = -EINVAL;
goto out;
}
@@ -92,6 +93,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid kernel address: %*ph\n",
(int)sizeof(buf->kernel_address),
buf->kernel_address);
+ ret = -EINVAL;
goto out;
}
@@ -100,6 +102,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid kernel length: %*ph\n",
(int)sizeof(buf->kernel_length),
buf->kernel_length);
+ ret = -EINVAL;
goto out;
}
@@ -108,6 +111,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid total length: %*ph\n",
(int)sizeof(buf->total_length),
buf->total_length);
+ ret = -EINVAL;
goto out;
}