aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_state.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2007-11-26 22:10:07 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2007-11-26 22:10:07 -0500
commit5dba4797115c8fa05c1a4d12927a6ae0b33ffc41 (patch)
tree6f515e0e29352ff06887ceb272e106e87966f709 /net/xfrm/xfrm_state.c
parent8a8037ac9dbe4eb20ce50aa20244faf77444f4a3 (diff)
[XFRM]: Fix leak of expired xfrm_states
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>
Diffstat (limited to 'net/xfrm/xfrm_state.c')
-rw-r--r--net/xfrm/xfrm_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 224b44e31a07..cf43c49eab37 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -552,7 +552,7 @@ int __xfrm_state_delete(struct xfrm_state *x)
552 * The xfrm_state_alloc call gives a reference, and that 552 * The xfrm_state_alloc call gives a reference, and that
553 * is what we are dropping here. 553 * is what we are dropping here.
554 */ 554 */
555 __xfrm_state_put(x); 555 xfrm_state_put(x);
556 err = 0; 556 err = 0;
557 } 557 }
558 558