[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5176e9a1-4fbc-440a-b369-24bae4311169@lunn.ch>
Date: Sat, 27 Apr 2024 15:23:57 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Simon Horman <horms@...nel.org>
Cc: 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>,
Dan Carpenter <dan.carpenter@...aro.org>, 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: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
> empty.
>
> Flagged by Smatch.
> Compile tested only.
>
> Signed-off-by: Simon Horman <horms@...nel.org>
For the code itself:
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists