lkml.org 
[lkml]   [2021]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] memstick: core: fix error return code of mspro_block_resume()
On Fri, 5 Mar 2021 at 03:14, Jia-Ju Bai <baijiaju1990@gmail.com> wrote:
>
> When mspro_block_init_card() fails, no error return code of
> mspro_block_resume() is assigned.
> To fix this bug, rc is assigned with the return value of
> mspro_block_init_card(), and then rc is checked.
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/memstick/core/mspro_block.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
> index afb892e7ffc6..cf7fe0d58ee7 100644
> --- a/drivers/memstick/core/mspro_block.c
> +++ b/drivers/memstick/core/mspro_block.c
> @@ -1382,7 +1382,8 @@ static int mspro_block_resume(struct memstick_dev *card)
>
> new_msb->card = card;
> memstick_set_drvdata(card, new_msb);
> - if (mspro_block_init_card(card))
> + rc = mspro_block_init_card(card);
> + if (rc)
> goto out_free;
>
> for (cnt = 0; new_msb->attr_group.attrs[cnt]
> --
> 2.17.1
>

\
 
 \ /
  Last update: 2021-03-09 10:04    [W:0.299 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site