Re: [PATCH net-next v5 3/4] net: macb: Add ARP support to WOL
From: Paolo Abeni
Date: Fri Jun 14 2024 - 05:16:36 EST
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