Commit da1e6fe5 authored by Yu Kuai's avatar Yu Kuai Committed by Miquel Raynal

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210408133812.1209798-1-yukuai3@huawei.com
parent c054de10
...@@ -270,6 +270,7 @@ static int phram_setup(const char *val) ...@@ -270,6 +270,7 @@ static int phram_setup(const char *val)
if (len == 0 || erasesize == 0 || erasesize > len if (len == 0 || erasesize == 0 || erasesize > len
|| erasesize > UINT_MAX || rem) { || erasesize > UINT_MAX || rem) {
parse_err("illegal erasesize or len\n"); parse_err("illegal erasesize or len\n");
ret = -EINVAL;
goto error; goto error;
} }
......
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