Commit e4f3c911 authored by Zhang Xiaoxu's avatar Zhang Xiaoxu Committed by Miquel Raynal

mtd: mtd_oobtest: fix error return code in mtd_oobtest_init()

Fix to 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 avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210409010739.1021001-1-zhangxiaoxu5@huawei.com
parent da1e6fe5
......@@ -701,6 +701,7 @@ static int __init mtd_oobtest_init(void)
(long long)addr);
errcnt += 1;
if (errcnt > 1000) {
err = -EINVAL;
pr_err("error: too many errors\n");
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