[RFC,3/6] l2tp: drop session refs in l2tp_tunnel_closeall

Message ID 1360923919-7203-4-git-send-email-tparkin@katalix.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Tom Parkin Feb. 15, 2013, 10:25 a.m.
l2tp_tunnel_closeall is intended to close and free all sessions running in a
given tunnel.  It lacked a session dereference, however, meaning these
sessions would all leak rather than being properly freed.

Add a session deref call in l2tp_tunnel_closeall to prevent this leak.

 net/l2tp/l2tp_core.c |    2 ++
 1 file changed, 2 insertions(+)


diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 3842f67..7f3ab65 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1328,6 +1328,8 @@  again:
 			if (session->deref != NULL)
+			l2tp_session_dec_refcount(session);
 			/* Now restart from the beginning of this hash