提交 d3dcb7df 编写于 作者: Y Yu Kuai 提交者: Zheng Zengkai

mtd: phram: Fix error return code in phram_setup()

mainline inclusion
from mainline-v5.14-rc1
commit da1e6fe5
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I53BBP
backport: openEuler-22.03-LTS

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=da1e6fe563e62801fa033255f68c0bb9bf8c2c69

--------------------------------

Return a negative error code from the error handling case instead
of 0, as done elsewhere in this function.
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210408133812.1209798-1-yukuai3@huawei.comSigned-off-by: NYi Yang <yiyang13@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a9378a0a
...@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册