Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Greg KH
On Thu, Mar 25, 2021 at 07:03:39PM +0800, Jian Dong wrote: > On Thu, 25 Mar 2021 11:29:06 +0100 > Greg KH wrote: > > > On Thu, Mar 25, 2021 at 06:19:26PM +0800, Jian Dong wrote: > > > From: Jian Dong > > > > > > fixes coccicheck Error: > > > > > > drivers/staging/greybus/bootrom.c:301:41-45:

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Jian Dong
On Thu, 25 Mar 2021 11:29:06 +0100 Greg KH wrote: > On Thu, Mar 25, 2021 at 06:19:26PM +0800, Jian Dong wrote: > > From: Jian Dong > > > > fixes coccicheck Error: > > > > drivers/staging/greybus/bootrom.c:301:41-45: ERROR: > > fw is NULL but dereferenced. > > > > if procedure goto label d

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Viresh Kumar
On 25-03-21, 18:19, Jian Dong wrote: > From: Jian Dong > > fixes coccicheck Error: > > drivers/staging/greybus/bootrom.c:301:41-45: ERROR: > fw is NULL but dereferenced. > > if procedure goto label directly, ret will be nefative, so the fw is NULL > and the if(condition) end with dereferen

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Dan Carpenter
The commit description is not clear but this patch doesn't change how the code works, it just silences a static checker false positive. Just ignore the false positive. Always just ignore static checkers when they are wrong. regards, dan carpenter ___

[PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Jian Dong
From: Jian Dong fixes coccicheck Error: drivers/staging/greybus/bootrom.c:301:41-45: ERROR: fw is NULL but dereferenced. if procedure goto label directly, ret will be nefative, so the fw is NULL and the if(condition) end with dereferenced fw. let's fix it. Signed-off-by: Jian Dong --- d

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Greg KH
On Thu, Mar 25, 2021 at 06:19:26PM +0800, Jian Dong wrote: > From: Jian Dong > > fixes coccicheck Error: > > drivers/staging/greybus/bootrom.c:301:41-45: ERROR: > fw is NULL but dereferenced. > > if procedure goto label directly, ret will be nefative, so the fw is NULL > and the if(conditi

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced.

2020-01-26 Thread Greg KH
On Sun, Jan 26, 2020 at 02:01:30PM +0530, Saurav Girepunje wrote: > Fix the warning reported by cocci check. What is "cocci check"? > Changes: > Why add that line? > In queue_work fw dereference before it actually get assigned. > move queue_work before gb_bootrom_set_timeout. > > As gb_bootro

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced.

2020-01-26 Thread Johan Hovold
On Sun, Jan 26, 2020 at 02:01:30PM +0530, Saurav Girepunje wrote: > Fix the warning reported by cocci check. > > Changes: > > In queue_work fw dereference before it actually get assigned. > move queue_work before gb_bootrom_set_timeout. Nope. As I said yesterday, you need to verify the output of

[PATCH] staging: greybus: fix fw is NULL but dereferenced.

2020-01-26 Thread Saurav Girepunje
Fix the warning reported by cocci check. Changes: In queue_work fw dereference before it actually get assigned. move queue_work before gb_bootrom_set_timeout. As gb_bootrom_get_firmware () return NEXT_REQ_READY_TO_BOOT only when there is no error and offset + size is actually equal to fw->size.