Skip to content

Commit

Permalink
[PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall()
Browse files Browse the repository at this point in the history
Every skb removed from session->reorder_q needs sock_put().

Signed-off-by: Jarek Poplawski <[email protected]>
Acked-by: James Chapman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Jarek Poplawski authored and davem330 committed Mar 4, 2008
1 parent c8fff1c commit ec9b6ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/pppol2tp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1139,7 +1141,10 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel)
/* 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);
Expand Down

0 comments on commit ec9b6ad

Please sign in to comment.