Skip to content

Commit

Permalink
netpoll: zap_completion_queue: adjust skb->users counter
Browse files Browse the repository at this point in the history
zap_completion_queue() retrieves skbs from completion_queue where they have
zero skb->users counter.  Before dev_kfree_skb_any() it should be non-zero
yet, so it's increased now.

Reported-and-tested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Mar 20, 2008
1 parent 2bec008 commit 8a455b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
@@ -215,10 +215,12 @@ static void zap_completion_queue(void)
while (clist != NULL) {
struct sk_buff *skb = clist;
clist = clist->next;
if (skb->destructor)
if (skb->destructor) {
atomic_inc(&skb->users);
dev_kfree_skb_any(skb); /* put this one back */
else
} else {
__kfree_skb(skb);
}
}
}

0 comments on commit 8a455b0

Please sign in to comment.