public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Vineeth Karumanchi <vineeth.karumanchi@amd.com>,
	 nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	robh+dt@kernel.org,  krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, linux@armlinux.org.uk,
	 vadim.fedorenko@linux.dev, andrew@lunn.ch
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org, git@amd.com
Subject: Re: [PATCH net-next v5 3/4] net: macb: Add ARP support to WOL
Date: Fri, 14 Jun 2024 11:16:17 +0200	[thread overview]
Message-ID: <a02fac3b21a97dc766d65c4ed2d080f1ed87e87e.camel@redhat.com> (raw)
In-Reply-To: <20240611162827.887162-4-vineeth.karumanchi@amd.com>

Hi,

On Tue, 2024-06-11 at 21:58 +0530, Vineeth Karumanchi wrote:
> @@ -5257,6 +5247,12 @@ static int __maybe_unused macb_suspend(struct device *dev)
>  		return 0;
>  
>  	if (bp->wol & MACB_WOL_ENABLED) {
> +		/* Check for IP address in WOL ARP mode */
> +		ifa = rcu_dereference(__in_dev_get_rcu(bp->dev)->ifa_list);

I'm sorry for the late feedback, but:
- you can use rcu_access_pointer() here instead of rcu_dereference()
- (much more importantly) __in_dev_get_rcu() can return a NULL pointer,
you can't unconditionally dereference it.

Thanks!

Paolo


  reply	other threads:[~2024-06-14  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 16:28 [PATCH net-next v5 0/4] net: macb: WOL enhancements Vineeth Karumanchi
2024-06-11 16:28 ` [PATCH net-next v5 1/4] net: macb: queue tie-off or disable during WOL suspend Vineeth Karumanchi
2024-06-11 16:28 ` [PATCH net-next v5 2/4] net: macb: Enable queue disable Vineeth Karumanchi
2024-06-11 16:28 ` [PATCH net-next v5 3/4] net: macb: Add ARP support to WOL Vineeth Karumanchi
2024-06-14  9:16   ` Paolo Abeni [this message]
2024-06-11 16:28 ` [PATCH net-next v5 4/4] dt-bindings: net: cdns,macb: Deprecate magic-packet property Vineeth Karumanchi

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=a02fac3b21a97dc766d65c4ed2d080f1ed87e87e.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=git@amd.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vineeth.karumanchi@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox