Skip to content

Commit d295027

Browse files
Florian Westphalklassert
authored andcommitted
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: ec30d78 ("xfrm: add xdst pcpu cache") Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent 732706a commit d295027

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/xfrm/xfrm_policy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,7 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols,
18391839
sizeof(struct xfrm_policy *) * num_pols) == 0 &&
18401840
xfrm_xdst_can_reuse(xdst, xfrm, err)) {
18411841
dst_hold(&xdst->u.dst);
1842+
xfrm_pols_put(pols, num_pols);
18421843
while (err > 0)
18431844
xfrm_state_put(xfrm[--err]);
18441845
return xdst;

0 commit comments

Comments
 (0)