diff options
author | Eric Dumazet <edumazet@google.com> | 2021-12-04 20:22:14 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-06 16:05:44 -0800 |
commit | 63f13937cbe9b00982dfc8e578b1aec8e5037333 (patch) | |
tree | fda38faf84f701c7d25ad885fa4cdfd0e5a747f8 /net/core | |
parent | 606509f27f67748b92f783a75a6e39cfaa2fe92d (diff) | |
download | linux-63f13937cbe9b00982dfc8e578b1aec8e5037333.tar.bz2 |
net: linkwatch: add net device refcount tracker
Add a netdevice_tracker inside struct net_device, to track
the self reference when a device is in lweventlist.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/link_watch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 9599afd0862d..d7d089963b1d 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -109,7 +109,7 @@ static void linkwatch_add_event(struct net_device *dev) spin_lock_irqsave(&lweventlist_lock, flags); if (list_empty(&dev->link_watch_list)) { list_add_tail(&dev->link_watch_list, &lweventlist); - dev_hold(dev); + dev_hold_track(dev, &dev->linkwatch_dev_tracker, GFP_ATOMIC); } spin_unlock_irqrestore(&lweventlist_lock, flags); } @@ -166,7 +166,7 @@ static void linkwatch_do_dev(struct net_device *dev) netdev_state_change(dev); } - dev_put(dev); + dev_put_track(dev, &dev->linkwatch_dev_tracker); } static void __linkwatch_run_queue(int urgent_only) |