[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2edecc5a-f9ad-47bc-9f1f-ce530fa75ef2@moroto.mountain>
Date: Sat, 27 Apr 2024 12:09:55 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Simon Horman <horms@...nel.org>
Cc: Andrew Lunn <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next RFC v2] net: dsa: mv88e6xxx: Correct check for
empty list
On Sat, Apr 27, 2024 at 09:53:06AM +0100, Simon Horman wrote:
> On Sat, Apr 27, 2024 at 09:52:03AM +0100, Simon Horman wrote:
> > Since commit a3c53be55c95 ("net: dsa: mv88e6xxx: Support multiple MDIO
> > busses") mv88e6xxx_default_mdio_bus() has checked that the
> > return value of list_first_entry() is non-NULL.
> >
> > This appears to be intended to guard against the list chip->mdios being
> > empty. However, it is not the correct check as the implementation of
> > list_first_entry is not designed to return NULL for empty lists.
> >
> > Instead, use list_first_entry() which does return NULL if the list is
^^^^^^^^^^^^^^^^^^
list_first_entry_or_null()
regards,
dan carpenter
Powered by blists - more mailing lists