diff options
| author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2024-10-17 11:31:33 -0700 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2024-10-24 16:03:40 +0200 |
| commit | 68ed5c38b512b734caf3da1f87db4a99fcfe3002 (patch) | |
| tree | a709369f723e643dc7813cc6f8eb7dbeb18d63d4 /net/phonet/pn_dev.c | |
| parent | 08a9572be36819b5d9011604edfa5db6c5062a7a (diff) | |
| download | linux-68ed5c38b512b734caf3da1f87db4a99fcfe3002.tar.gz linux-68ed5c38b512b734caf3da1f87db4a99fcfe3002.tar.bz2 linux-68ed5c38b512b734caf3da1f87db4a99fcfe3002.zip | |
phonet: Pass net and ifindex to phonet_address_notify().
Currently, phonet_address_notify() fetches netns and ifindex from dev.
Once addr_doit() is converted to RCU, phonet_address_notify() will be
called outside of RCU due to GFP_KERNEL, and dev will be unavailable
there.
Let's pass net and ifindex to phonet_address_notify().
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/phonet/pn_dev.c')
| -rw-r--r-- | net/phonet/pn_dev.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index cde671d29d5d..2e7d850dc726 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -98,10 +98,13 @@ static void phonet_device_destroy(struct net_device *dev) mutex_unlock(&pndevs->lock); if (pnd) { + struct net *net = dev_net(dev); + u32 ifindex = dev->ifindex; u8 addr; for_each_set_bit(addr, pnd->addrs, 64) - phonet_address_notify(RTM_DELADDR, dev, addr); + phonet_address_notify(net, RTM_DELADDR, ifindex, addr); + kfree(pnd); } } @@ -244,8 +247,9 @@ static int phonet_device_autoconf(struct net_device *dev) ret = phonet_address_add(dev, req.ifr_phonet_autoconf.device); if (ret) return ret; - phonet_address_notify(RTM_NEWADDR, dev, - req.ifr_phonet_autoconf.device); + + phonet_address_notify(dev_net(dev), RTM_NEWADDR, dev->ifindex, + req.ifr_phonet_autoconf.device); return 0; } |
