summaryrefslogtreecommitdiff
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2021-04-08 21:38:12 +0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-05-10 10:44:34 +0200
commitda1e6fe563e62801fa033255f68c0bb9bf8c2c69 (patch)
tree657964b65b92439ad206827df5bc6f0e9ad6ee4d /drivers/mtd/devices
parentc054de10ae5d6d8b3f417cb8d29e67a7cd686f36 (diff)
mtd: phram: Fix error return code in phram_setup()
Return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210408133812.1209798-1-yukuai3@huawei.com
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/phram.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 5b04ae6c3057..6ed6c51fac69 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -270,6 +270,7 @@ static int phram_setup(const char *val)
if (len == 0 || erasesize == 0 || erasesize > len
|| erasesize > UINT_MAX || rem) {
parse_err("illegal erasesize or len\n");
+ ret = -EINVAL;
goto error;
}