summaryrefslogtreecommitdiff
path: root/drivers/mtd/tests
diff options
context:
space:
mode:
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>2021-04-08 21:07:39 -0400
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-05-10 10:44:37 +0200
commite4f3c9118f27b3b400db9993dd8bfd028d3b86ca (patch)
treea4220cce7b52137e6ab3aec97c0713e41e6bd821 /drivers/mtd/tests
parentda1e6fe563e62801fa033255f68c0bb9bf8c2c69 (diff)
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
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r--drivers/mtd/tests/oobtest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c
index c71daa89bfce..590d619d2760 100644
--- a/drivers/mtd/tests/oobtest.c
+++ b/drivers/mtd/tests/oobtest.c
@@ -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;
}