[PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall()
authorJarek Poplawski <jarkao2@gmail.com>
Tue, 4 Mar 2008 04:49:34 +0000 (20:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Mar 2008 04:49:34 +0000 (20:49 -0800)
Every skb removed from session->reorder_q needs sock_put().

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Acked-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pppol2tp.c

index dcd499118b95c64aa1e2d7b77451df7d3723a4d3..86e5dba079fed6d9a62bcd6d9e9e31fb40888999 100644 (file)
@@ -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);