summary refs log tree commit diff
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-12-04 20:22:03 -0800
committerJakub Kicinski <kuba@kernel.org>2021-12-06 16:05:10 -0800
commit9038c320001dd07f60736018edf608ac5baca0ab (patch)
treefea21a92f9a586370c4c85a5aab4adca4c160e7f /net/ipv6
parent4dbd24f65c60259ce5d1563433ecaf5fab693c83 (diff)
downloadlinux-9038c320001dd07f60736018edf608ac5baca0ab.tar.gz
net: dst: add net device refcount tracking to dst_entry
We want to track all dev_hold()/dev_put() to ease leak hunting.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
-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 f0d29fcb2094..ba4dc94d76d6 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -182,8 +182,9 @@ static void rt6_uncached_list_flush_dev(struct net *net, struct net_device *dev)
 
 			if (rt_dev == dev) {
 				rt->dst.dev = blackhole_netdev;
-				dev_hold(rt->dst.dev);
-				dev_put(rt_dev);
+				dev_replace_track(rt_dev, blackhole_netdev,
+						  &rt->dst.dev_tracker,
+						  GFP_ATOMIC);
 			}
 		}
 		spin_unlock_bh(&ul->lock);