From: Yu Kuai Date: Thu, 8 Apr 2021 13:38:12 +0000 (+0800) Subject: mtd: phram: Fix error return code in phram_setup() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=da1e6fe563e62801fa033255f68c0bb9bf8c2c69;p=linux.git 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 Signed-off-by: Yu Kuai Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210408133812.1209798-1-yukuai3@huawei.com --- diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index 5b04ae6c30573..6ed6c51fac69e 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; }