From: Jarek Poplawski Date: Tue, 4 Mar 2008 04:49:34 +0000 (-0800) Subject: [PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall() X-Git-Tag: v2.6.25-rc4~2^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec9b6add7d81f902f6094e71f595da4a362f3348;p=linux-2.6 [PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall() Every skb removed from session->reorder_q needs sock_put(). Signed-off-by: Jarek Poplawski Acked-by: James Chapman Signed-off-by: David S. Miller --- diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index dcd499118b..86e5dba079 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c @@ -1111,6 +1111,8 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel) for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) { again: hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { + struct sk_buff *skb; + session = hlist_entry(walk, struct pppol2tp_session, hlist); sk = session->sock; @@ -1139,7 +1141,10 @@ again: /* Purge any queued data */ skb_queue_purge(&sk->sk_receive_queue); skb_queue_purge(&sk->sk_write_queue); - skb_queue_purge(&session->reorder_q); + while ((skb = skb_dequeue(&session->reorder_q))) { + kfree_skb(skb); + sock_put(sk); + } release_sock(sk); sock_put(sk);