diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-03-20 19:07:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-20 19:07:27 -0400 |
commit | 8a455b087c9629b3ae3b521b4f1ed16672f978cc (patch) | |
tree | db93f743a1d9add48876d9d0ccdbc2696c0f771f /net | |
parent | 2bec008ca9fd009aa503b75344d1c22da9256141 (diff) |
netpoll: zap_completion_queue: adjust skb->users counter
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/netpoll.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 4b7e756181c9..c635de52526c 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -215,10 +215,12 @@ static void zap_completion_queue(void) | |||
215 | while (clist != NULL) { | 215 | while (clist != NULL) { |
216 | struct sk_buff *skb = clist; | 216 | struct sk_buff *skb = clist; |
217 | clist = clist->next; | 217 | clist = clist->next; |
218 | if (skb->destructor) | 218 | if (skb->destructor) { |
219 | atomic_inc(&skb->users); | ||
219 | dev_kfree_skb_any(skb); /* put this one back */ | 220 | dev_kfree_skb_any(skb); /* put this one back */ |
220 | else | 221 | } else { |
221 | __kfree_skb(skb); | 222 | __kfree_skb(skb); |
223 | } | ||
222 | } | 224 | } |
223 | } | 225 | } |
224 | 226 | ||