All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Simon Horman <horms@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next RFC v2] net: dsa: mv88e6xxx: Correct check for empty list
Date: Sat, 27 Apr 2024 12:09:55 +0300	[thread overview]
Message-ID: <2edecc5a-f9ad-47bc-9f1f-ce530fa75ef2@moroto.mountain> (raw)
In-Reply-To: <20240427085306.GF516117@kernel.org>

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


  reply	other threads:[~2024-04-27  9:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  8:52 [PATCH net-next RFC v2] net: dsa: mv88e6xxx: Correct check for empty list Simon Horman
2024-04-27  8:53 ` Simon Horman
2024-04-27  9:09   ` Dan Carpenter [this message]
2024-04-27 13:23 ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2edecc5a-f9ad-47bc-9f1f-ce530fa75ef2@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.