diff mbox series

[v2] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init()

Message ID 20210409010739.1021001-1-zhangxiaoxu5@huawei.com
State Accepted
Delegated to: Miquel Raynal
Headers show
Series [v2] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init() | expand

Commit Message

zhangxiaoxu (A) April 9, 2021, 1:07 a.m. UTC
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>
---
 drivers/mtd/tests/oobtest.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Miquel Raynal May 10, 2021, 9:09 a.m. UTC | #1
On Fri, 2021-04-09 at 01:07:39 UTC, Zhang Xiaoxu wrote:
> 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>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel
diff mbox series

Patch

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