public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: parser_imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()
@ 2021-01-28  9:36 Dan Carpenter
  2021-01-28 21:25 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-01-28  9:36 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Florian Fainelli, Jonas Gorski, linux-mtd, linux-kernel,
	kernel-janitors

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>
---
 drivers/mtd/parsers/parser_imagetag.c | 4 ++++
 1 file changed, 4 insertions(+)

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;
 		}
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: parser_imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()
  2021-01-28  9:36 [PATCH] mtd: parser_imagetag: fix error codes in bcm963xx_parse_imagetag_partitions() Dan Carpenter
@ 2021-01-28 21:25 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2021-01-28 21:25 UTC (permalink / raw)
  To: Dan Carpenter, Miquel Raynal
  Cc: Rob Herring, Florian Fainelli, Vignesh Raghavendra,
	Richard Weinberger, kernel-janitors, linux-kernel, linux-mtd,
	Jonas Gorski

On Thu, 2021-01-28 at 09:36:52 UTC, Dan Carpenter wrote:
> 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>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-28 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-28  9:36 [PATCH] mtd: parser_imagetag: fix error codes in bcm963xx_parse_imagetag_partitions() Dan Carpenter
2021-01-28 21:25 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox