netpoll: Remove strong unnecessary assumptions about skbs
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 27 Mar 2014 22:41:04 +0000 (15:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Mar 2014 21:58:37 +0000 (17:58 -0400)
Remove the assumption that the skbs that make it to
netpoll_send_skb_on_dev are allocated with find_skb, such that
skb->users == 1 and nothing is attached that would prevent the skbs from
being freed from hard irq context.

Remove this assumption by replacing __kfree_skb on error paths with
dev_kfree_skb_irq (in hard irq context) and kfree_skb (in process
context).

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

index 9fd88875faff55cd6af27e4ebc51c5b62f258afa..d44af2306f235ca88a20338a2c216b703ac3a9be 100644 (file)
@@ -112,7 +112,7 @@ static void queue_process(struct work_struct *work)
                struct netdev_queue *txq;
 
                if (!netif_device_present(dev) || !netif_running(dev)) {
-                       __kfree_skb(skb);
+                       kfree_skb(skb);
                        continue;
                }
 
@@ -332,7 +332,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
 
        npinfo = rcu_dereference_bh(np->dev->npinfo);
        if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) {
-               __kfree_skb(skb);
+               dev_kfree_skb_irq(skb);
                return;
        }