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:
Zhang Xiaoxu 2021-04-08 21:07:39 -04:00 committed by Miquel Raynal
parent da1e6fe563
commit e4f3c9118f
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}