summaryrefslogtreecommitdiffstats
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-12-05 05:22:09 +0100
committerJakub Kicinski <kuba@kernel.org>2021-12-07 01:05:11 +0100
commit08d622568e5a58adebc8cb801599d3f181a6b687 (patch)
tree7aa0e61c75323368ca482fe44da9646d565fc22d /net/core/neighbour.c
parentnet: add net device refcount tracker to struct pneigh_entry (diff)
downloadlinux-08d622568e5a58adebc8cb801599d3f181a6b687.tar.xz
linux-08d622568e5a58adebc8cb801599d3f181a6b687.zip
net: add net device refcount tracker to struct neigh_parms
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 56de74f8d2b1..dd271ffedf11 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1666,13 +1666,13 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
refcount_set(&p->refcnt, 1);
p->reachable_time =
neigh_rand_reach_time(NEIGH_VAR(p, BASE_REACHABLE_TIME));
- dev_hold(dev);
+ dev_hold_track(dev, &p->dev_tracker, GFP_KERNEL);
p->dev = dev;
write_pnet(&p->net, net);
p->sysctl_table = NULL;
if (ops->ndo_neigh_setup && ops->ndo_neigh_setup(dev, p)) {
- dev_put(dev);
+ dev_put_track(dev, &p->dev_tracker);
kfree(p);
return NULL;
}
@@ -1703,7 +1703,7 @@ void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms)
list_del(&parms->list);
parms->dead = 1;
write_unlock_bh(&tbl->lock);
- dev_put(parms->dev);
+ dev_put_track(parms->dev, &parms->dev_tracker);
call_rcu(&parms->rcu_head, neigh_rcu_free_parms);
}
EXPORT_SYMBOL(neigh_parms_release);