From e4f3c9118f27b3b400db9993dd8bfd028d3b86ca Mon Sep 17 00:00:00 2001 From: Zhang Xiaoxu Date: Thu, 8 Apr 2021 21:07:39 -0400 Subject: 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 Signed-off-by: Zhang Xiaoxu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210409010739.1021001-1-zhangxiaoxu5@huawei.com --- drivers/mtd/tests/oobtest.c | 1 + 1 file changed, 1 insertion(+) 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; } -- cgit v1.2.3