2021-03-05 02:47:06

by Jia-Ju Bai

[permalink] [raw]
Subject: [BUG] memstick: core: missing error return code in msb_resume()

My static analysis tool reports that no error return code is assigned in
error handling code of msb_resume().
However, many other drivers assign error return code in xxx_resume(),
such as sky2_resume() and e1000_resume().
I wonder whether this is intentional?


Best wishes,
Jia-Ju Bai


2021-03-09 08:46:25

by Ulf Hansson

[permalink] [raw]
Subject: Re: [BUG] memstick: core: missing error return code in msb_resume()

On Fri, 5 Mar 2021 at 03:45, Jia-Ju Bai <[email protected]> wrote:
>
> My static analysis tool reports that no error return code is assigned in
> error handling code of msb_resume().
> However, many other drivers assign error return code in xxx_resume(),
> such as sky2_resume() and e1000_resume().
> I wonder whether this is intentional?

It's for sure intentional, but it really doesn't matter that much as
we are probably in rather dodgy state anyways.

Of course, propagating error codes upwards in the stack is always good
practise, so feel free to add it.

Kind regards
Uffe

2021-03-09 13:41:44

by Jia-Ju Bai

[permalink] [raw]
Subject: Re: [BUG] memstick: core: missing error return code in msb_resume()



On 2021/3/9 16:44, Ulf Hansson wrote:
> On Fri, 5 Mar 2021 at 03:45, Jia-Ju Bai <[email protected]> wrote:
>> My static analysis tool reports that no error return code is assigned in
>> error handling code of msb_resume().
>> However, many other drivers assign error return code in xxx_resume(),
>> such as sky2_resume() and e1000_resume().
>> I wonder whether this is intentional?
> It's for sure intentional, but it really doesn't matter that much as
> we are probably in rather dodgy state anyways.
>
> Of course, propagating error codes upwards in the stack is always good
> practise, so feel free to add it.
>

Thanks for the reply!
I will find time to add error return code in this function :)


Best wishes,
Jia-Ju Bai