diff options
author | Patrick McHardy <kaber@trash.net> | 2007-11-29 23:07:57 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-14 10:32:00 -0800 |
commit | e01dcced45f895797dfba326bdb10d8d85e13eee (patch) | |
tree | a51ae6d179ff567f69247a34b22dddb9478f3b04 /net | |
parent | fc79ad5a2c4360a2ecc028a44cdffaa1634d7a14 (diff) |
XFRM: Fix leak of expired xfrm_states
[XFRM]: Fix leak of expired xfrm_states
[ Upstream commit: 5dba4797115c8fa05c1a4d12927a6ae0b33ffc41 ]
The xfrm_timer calls __xfrm_state_delete, which drops the final reference
manually without triggering destruction of the state. Change it to use
xfrm_state_put to add the state to the gc list when we're dropping the
last reference. The timer function may still continue to use the state
safely since the final destruction does a del_timer_sync().
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index dfacb9c2a6e..77754886c62 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -371,7 +371,7 @@ int __xfrm_state_delete(struct xfrm_state *x) * The xfrm_state_alloc call gives a reference, and that * is what we are dropping here. */ - __xfrm_state_put(x); + xfrm_state_put(x); err = 0; } |