diff options
author | Eric Dumazet <edumazet@google.com> | 2021-12-05 07:22:08 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-07 03:05:11 +0300 |
commit | 77a23b1f954381d7999ce069d3fc8658eb6a9bbc (patch) | |
tree | 5ffc96ff36963cfef49166c232cfc9f64bbdd2fa /net/core/neighbour.c | |
parent | 85662c9f8cbd4c96088ff99f56bc3d1097d0ac07 (diff) | |
download | linux-77a23b1f954381d7999ce069d3fc8658eb6a9bbc.tar.xz |
net: add net device refcount tracker to struct pneigh_entry
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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index fb340347e4d8..56de74f8d2b1 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -771,10 +771,10 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, write_pnet(&n->net, net); memcpy(n->key, pkey, key_len); n->dev = dev; - dev_hold(dev); + dev_hold_track(dev, &n->dev_tracker, GFP_KERNEL); if (tbl->pconstructor && tbl->pconstructor(n)) { - dev_put(dev); + dev_put_track(dev, &n->dev_tracker); kfree(n); n = NULL; goto out; @@ -806,7 +806,7 @@ int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *pkey, write_unlock_bh(&tbl->lock); if (tbl->pdestructor) tbl->pdestructor(n); - dev_put(n->dev); + dev_put_track(n->dev, &n->dev_tracker); kfree(n); return 0; } @@ -839,7 +839,7 @@ static int pneigh_ifdown_and_unlock(struct neigh_table *tbl, n->next = NULL; if (tbl->pdestructor) tbl->pdestructor(n); - dev_put(n->dev); + dev_put_track(n->dev, &n->dev_tracker); kfree(n); } return -ENOENT; |