summaryrefslogtreecommitdiffstats
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-12-04 20:22:04 -0800
committerJakub Kicinski <kuba@kernel.org>2021-12-06 16:05:11 -0800
commitfb67510ba9bd3ed1f8a2db4946e847ca0418f8dc (patch)
treef98ee60ec317ffb19fe023dbaad5ce8243f9a548 /net/ipv6/route.c
parent9038c320001dd07f60736018edf608ac5baca0ab (diff)
downloadlinux-fb67510ba9bd3ed1f8a2db4946e847ca0418f8dc.tar.bz2
ipv6: add net device refcount tracker to rt6_probe_deferred()
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index ba4dc94d76d6..8d834f901b48 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -593,6 +593,7 @@ struct __rt6_probe_work {
struct work_struct work;
struct in6_addr target;
struct net_device *dev;
+ netdevice_tracker dev_tracker;
};
static void rt6_probe_deferred(struct work_struct *w)
@@ -603,7 +604,7 @@ static void rt6_probe_deferred(struct work_struct *w)
addrconf_addr_solict_mult(&work->target, &mcaddr);
ndisc_send_ns(work->dev, &work->target, &mcaddr, NULL, 0);
- dev_put(work->dev);
+ dev_put_track(work->dev, &work->dev_tracker);
kfree(work);
}
@@ -657,7 +658,7 @@ static void rt6_probe(struct fib6_nh *fib6_nh)
} else {
INIT_WORK(&work->work, rt6_probe_deferred);
work->target = *nh_gw;
- dev_hold(dev);
+ dev_hold_track(dev, &work->dev_tracker, GFP_KERNEL);
work->dev = dev;
schedule_work(&work->work);
}