diff options
author | Florian Westphal <fw@strlen.de> | 2017-12-11 12:23:09 -0500 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2017-12-12 00:39:05 -0500 |
commit | d2950278d2d04ff5314abeb38d9c59c4e7c0ee53 (patch) | |
tree | 9c9313f9c950711842fa6a2dc0d0745d831ac575 | |
parent | 732706afe1cc46ef48493b3d2b69c98f36314ae4 (diff) |
xfrm: put policies when reusing pcpu xdst entry
We need to put the policies when re-using the pcpu xdst entry, else
this leaks the reference.
Fixes: ec30d78c14a813db39a647b6a348b428 ("xfrm: add xdst pcpu cache")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | net/xfrm/xfrm_policy.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 038ec68f6901..70aa5cb0c659 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1839,6 +1839,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, | |||
1839 | sizeof(struct xfrm_policy *) * num_pols) == 0 && | 1839 | sizeof(struct xfrm_policy *) * num_pols) == 0 && |
1840 | xfrm_xdst_can_reuse(xdst, xfrm, err)) { | 1840 | xfrm_xdst_can_reuse(xdst, xfrm, err)) { |
1841 | dst_hold(&xdst->u.dst); | 1841 | dst_hold(&xdst->u.dst); |
1842 | xfrm_pols_put(pols, num_pols); | ||
1842 | while (err > 0) | 1843 | while (err > 0) |
1843 | xfrm_state_put(xfrm[--err]); | 1844 | xfrm_state_put(xfrm[--err]); |
1844 | return xdst; | 1845 | return xdst; |