diff options
author | Eric Dumazet <edumazet@google.com> | 2021-12-09 18:44:51 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-12-10 19:16:33 +0300 |
commit | e1b539bd73a76dc8a7bf82befe6eac4ae79c76b3 (patch) | |
tree | c54db186866f0de34debc908ec348ba1dc1fc0b3 /net/xfrm | |
parent | 3d20408dff9c0885591c8e1d31a67e9183f0cc8a (diff) | |
download | linux-e1b539bd73a76dc8a7bf82befe6eac4ae79c76b3.tar.xz |
xfrm: add net device refcount tracker to struct xfrm_state_offload
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Link: https://lore.kernel.org/r/20211209154451.4184050-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c index e843b0d9e2a6..3fa066419d37 100644 --- a/net/xfrm/xfrm_device.c +++ b/net/xfrm/xfrm_device.c @@ -259,6 +259,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, } xso->dev = dev; + netdev_tracker_alloc(dev, &xso->dev_tracker, GFP_ATOMIC); xso->real_dev = dev; xso->num_exthdrs = 1; xso->flags = xuo->flags; @@ -269,7 +270,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x, xso->flags = 0; xso->dev = NULL; xso->real_dev = NULL; - dev_put(dev); + dev_put_track(dev, &xso->dev_tracker); if (err != -EOPNOTSUPP) return err; |