netpoll: zap_completion_queue: adjust skb->users counter
authorJarek Poplawski <jarkao2@gmail.com>
Thu, 20 Mar 2008 23:07:27 +0000 (16:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Mar 2008 23:07:27 +0000 (16:07 -0700)
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>
net/core/netpoll.c

index 4b7e756181c9ec96eea6b0f5397aec3c87008a5a..c635de52526c9ddcd155cbf12d87b315a116c80f 100644 (file)
@@ -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);
+                       }
                }
        }