Message ID | dc1db7b00f7a9f18edfe4148dffacc2a5381e824.1681906552.git.leon@kernel.org (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Couple of error unwind fixes to packet offload | expand |
On Wed, Apr 19, 2023 at 03:19:08PM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@nvidia.com> > > At the stage of direction checks, the netdev reference tracker is > already initialized, but released with wrong *_put() call. > > Fixes: 919e43fad516 ("xfrm: add an interface to offload policy") > Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Simon Horman <simon.horman@corigine.com>
On Wed, Apr 19, 2023 at 2:19 PM Leon Romanovsky <leon@kernel.org> wrote: > > From: Leon Romanovsky <leonro@nvidia.com> > > At the stage of direction checks, the netdev reference tracker is > already initialized, but released with wrong *_put() call. > > Fixes: 919e43fad516 ("xfrm: add an interface to offload policy") > Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Eric Dumazet <edumazet@google.com>
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c index bef28c6187eb..408f5e55744e 100644 --- a/net/xfrm/xfrm_device.c +++ b/net/xfrm/xfrm_device.c @@ -378,7 +378,7 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp, break; default: xdo->dev = NULL; - dev_put(dev); + netdev_put(dev, &xdo->dev_tracker); NL_SET_ERR_MSG(extack, "Unrecognized offload direction"); return -EINVAL; }