mtd: parser_imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/mtd/parsers/parser_imagetag.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mtd/parsers/parser_imagetag.c +4 -0
@@ -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; }
Signature · 1 line
2.29.2
Quoted 5 lines · Dan Carpenter
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 <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel