[PATCH linux dev-4.10] drivers: occ: Fix bad list access

Andrew Jeffery andrew at aj.id.au
Wed Aug 23 17:23:24 AEST 2017


On Tue, 2017-08-22 at 17:00 -0500, Eddie James wrote:
> > From: "Edward A. James" <eajames at us.ibm.com>
> 
> list_first_entry() doesn't return NULL if the list is empty...
> 
> Signed-off-by: Edward A. James <eajames at us.ibm.com>

Thanks, applied to dev-4.10.

Andrew

> ---
>  drivers/fsi/occ.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fsi/occ.c b/drivers/fsi/occ.c
> index d984e51..621fbf0 100644
> --- a/drivers/fsi/occ.c
> +++ b/drivers/fsi/occ.c
> @@ -572,7 +572,7 @@ static void occ_worker(struct work_struct *work)
>  again:
> >  	spin_lock_irq(&occ->list_lock);
>  
> > -	xfr = list_first_entry(&occ->xfrs, struct occ_xfr, link);
> > +	xfr = list_first_entry_or_null(&occ->xfrs, struct occ_xfr, link);
> >  	if (!xfr) {
> >  		spin_unlock_irq(&occ->list_lock);
> >  		return;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170823/1075eb55/attachment.sig>


More information about the openbmc mailing list