mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
xfrm: Fix leak of dev tracker
At the stage of direction checks, the netdev reference tracker is
already initialized, but released with wrong *_put() call.
Fixes: 919e43fad5
("xfrm: add an interface to offload policy")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
94b95dfaa8
commit
ec8f32ad9a
@ -378,7 +378,7 @@ int xfrm_dev_policy_add(struct net *net, struct xfrm_policy *xp,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
xdo->dev = NULL;
|
xdo->dev = NULL;
|
||||||
dev_put(dev);
|
netdev_put(dev, &xdo->dev_tracker);
|
||||||
NL_SET_ERR_MSG(extack, "Unrecognized offload direction");
|
NL_SET_ERR_MSG(extack, "Unrecognized offload direction");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user