Skip to content

Commit 78347c8

Browse files
spellingmistakedavem330
authored andcommitted
xfrm: Fix xfrm_state_migrate leak
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 <[email protected]> Signed-off-by: Steffen Klassert <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fb4fa76 commit 78347c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xfrm/xfrm_state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
12681268

12691269
return xc;
12701270
error:
1271-
kfree(xc);
1271+
xfrm_state_put(xc);
12721272
return NULL;
12731273
}
12741274
EXPORT_SYMBOL(xfrm_state_migrate);

0 commit comments

Comments
 (0)