From: Zhang Xiaoxu Date: Fri, 9 Apr 2021 01:07:39 +0000 (-0400) Subject: mtd: mtd_oobtest: fix error return code in mtd_oobtest_init() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e4f3c9118f27b3b400db9993dd8bfd028d3b86ca;p=linux.git 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 --- diff --git a/drivers/mtd/tests/oobtest.c b/drivers/mtd/tests/oobtest.c index c71daa89bfce0..590d619d2760e 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; }