lkml.org 
[lkml]   [2021]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2] mtd: phram: Fix error return code in phram_setup()
Hi Yu,

Yu Kuai <yukuai3@huawei.com> wrote on Thu, 8 Apr 2021 21:38:12 +0800:

> 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: Yu Kuai <yukuai3@huawei.com>
> ---
> drivers/mtd/devices/phram.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
> index 5b04ae6c3057..6ed6c51fac69 100644
> --- a/drivers/mtd/devices/phram.c
> +++ b/drivers/mtd/devices/phram.c
> @@ -270,6 +270,7 @@ static int phram_setup(const char *val)
> if (len == 0 || erasesize == 0 || erasesize > len
> || erasesize > UINT_MAX || rem) {
> parse_err("illegal erasesize or len\n");
> + ret = -EINVAL;
> goto error;
> }
>

Actually I don't know why but I overlooked the change. I thought you
were removing the ret = line, sorry about that. Anyway, I prefer
the new wording so I'll apply the v2.

Thanks,
Miquèl

\
 
 \ /
  Last update: 2021-04-08 15:34    [W:0.048 / U:2.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site