Skip to content

Commit

Permalink
xfrm: Fix xfrm_state_migrate leak
Browse files Browse the repository at this point in the history
xfrm_state_migrate calls kfree instead of xfrm_state_put to free
a failed state. According to git commit 553f911 this can cause
memory leaks.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Egerer authored and David S. Miller committed Dec 10, 2010
1 parent fb4fa76 commit 78347c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,

return xc;
error:
kfree(xc);
xfrm_state_put(xc);
return NULL;
}
EXPORT_SYMBOL(xfrm_state_migrate);
Expand Down

0 comments on commit 78347c8

Please sign in to comment.