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: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210409010739.1021001-1-zhangxiaoxu5@huawei.com
This commit is contained in:
parent
da1e6fe563
commit
e4f3c9118f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue