Commit 12ba8f8c authored by Dan Carpenter's avatar Dan Carpenter Committed by Miquel Raynal

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: dd84cb02 ("mtd: bcm63xxpart: move imagetag parsing to its own parser")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/YBKFtNaFHGYBj+u4@mwanda
parent dc2b3e5c
...@@ -83,6 +83,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, ...@@ -83,6 +83,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid rootfs address: %*ph\n", pr_err("invalid rootfs address: %*ph\n",
(int)sizeof(buf->flash_image_start), (int)sizeof(buf->flash_image_start),
buf->flash_image_start); buf->flash_image_start);
ret = -EINVAL;
goto out; goto out;
} }
...@@ -92,6 +93,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, ...@@ -92,6 +93,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid kernel address: %*ph\n", pr_err("invalid kernel address: %*ph\n",
(int)sizeof(buf->kernel_address), (int)sizeof(buf->kernel_address),
buf->kernel_address); buf->kernel_address);
ret = -EINVAL;
goto out; goto out;
} }
...@@ -100,6 +102,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, ...@@ -100,6 +102,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid kernel length: %*ph\n", pr_err("invalid kernel length: %*ph\n",
(int)sizeof(buf->kernel_length), (int)sizeof(buf->kernel_length),
buf->kernel_length); buf->kernel_length);
ret = -EINVAL;
goto out; goto out;
} }
...@@ -108,6 +111,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, ...@@ -108,6 +111,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
pr_err("invalid total length: %*ph\n", pr_err("invalid total length: %*ph\n",
(int)sizeof(buf->total_length), (int)sizeof(buf->total_length),
buf->total_length); buf->total_length);
ret = -EINVAL;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment