netpoll: Use skb_irq_freeable to make zap_completion_queue safe.
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 1 Apr 2014 19:21:02 +0000 (12:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Apr 2014 21:53:36 +0000 (17:53 -0400)
Replace the test in zap_completion_queue to test when it is safe to
free skbs in hard irq context with skb_irq_freeable ensuring we only
free skbs when it is safe, and removing the possibility of subtle
problems.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c

index ed7740f..e33937f 100644 (file)
@@ -270,7 +270,7 @@ static void zap_completion_queue(void)
                while (clist != NULL) {
                        struct sk_buff *skb = clist;
                        clist = clist->next;
-                       if (skb->destructor) {
+                       if (!skb_irq_freeable(skb)) {
                                atomic_inc(&skb->users);
                                dev_kfree_skb_any(skb); /* put this one back */
                        } else {