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)) > next_request = NEXT_REQ_READY_TO_BOOT; > else > next_request = NEXT_REQ_GET_FIRMWARE; Johan _______________________________________________ greybus-dev mailing list greybus-dev@xxxxxxxxxxxxxxxx https://lists.linaro.org/mailman/listinfo/greybus-dev
![]() |