Re: [PATCH] staging: greybus: Fix NULL ptr reference in gb_bootrom_get_firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 05, 2020 at 02:27:19PM +0200, Johan Hovold wrote:
> On Thu, Sep 03, 2020 at 09:57:42AM +0800, Ye Bin wrote:
> > In gb_bootrom_get_firmware funtion fw maybe null, we must test it before
> > use it.
> 
> No, fw will never be NULL when ret is zero so the current code is
> correct.
> 
> Greg, please drop this one from your testing branch.
> 
> > Signed-off-by: Ye Bin <yebin10@xxxxxxxxxx>
> > ---
> >  drivers/staging/greybus/bootrom.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c
> > index a8efb86de140..e1573a5febf0 100644
> > --- a/drivers/staging/greybus/bootrom.c
> > +++ b/drivers/staging/greybus/bootrom.c
> > @@ -298,7 +298,7 @@ static int gb_bootrom_get_firmware(struct gb_operation *op)
> >  
> >  queue_work:
> >  	/* Refresh timeout */
> > -	if (!ret && (offset + size == fw->size))
> > +	if (!ret && fw && (offset + size == fw->size))

Ah, missed that ret would be checked first here, thanks for catching
that.

Now dropped.

greg k-h
_______________________________________________
greybus-dev mailing list
greybus-dev@xxxxxxxxxxxxxxxx
https://lists.linaro.org/mailman/listinfo/greybus-dev




[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux