All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init()
@ 2021-04-08 14:24 Zhang Xiaoxu
  2021-04-08 14:29 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Xiaoxu @ 2021-04-08 14:24 UTC (permalink / raw)
  To: zhangxiaoxu5, yukuai3, miquel.raynal, richard, vigneshr, linux-mtd

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: zhangxiaoxu 00467499 <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;
 			}
-- 
2.25.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init()
  2021-04-08 14:24 [PATCH] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init() Zhang Xiaoxu
@ 2021-04-08 14:29 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2021-04-08 14:29 UTC (permalink / raw)
  To: Zhang Xiaoxu; +Cc: yukuai3, richard, vigneshr, linux-mtd

Hi Zhang,

Zhang Xiaoxu <zhangxiaoxu5@huawei.com> wrote on Thu, 8 Apr 2021
10:24:13 -0400:

> 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: zhangxiaoxu 00467499 <zhangxiaoxu5@huawei.com>
                     ^^^^^^^^^^^^^^
Can you please use your real name here?

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

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-08 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 14:24 [PATCH] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init() Zhang Xiaoxu
2021-04-08 14:29 ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.