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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
			}