[PATCH] mtd: mtd_oobtest: fix error return code in mtd_oobtest_init()
Miquel Raynal
miquel.raynal at bootlin.com
Thu Apr 8 15:29:06 BST 2021
Hi Zhang,
Zhang Xiaoxu <zhangxiaoxu5 at 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 at huawei.com>
> Signed-off-by: zhangxiaoxu 00467499 <zhangxiaoxu5 at 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
More information about the linux-mtd
mailing list