]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[XFRM]: Fix leak of expired xfrm_states
authorPatrick McHardy <kaber@trash.net>
Tue, 27 Nov 2007 03:10:07 +0000 (11:10 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 27 Nov 2007 03:10:07 +0000 (11:10 +0800)
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>
net/xfrm/xfrm_state.c

index 224b44e31a07b934091f79e42b85888ab143925f..cf43c49eab37f3c2abfee6c707fc1c24934662f0 100644 (file)
@@ -552,7 +552,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;
        }