diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2014-03-27 18:41:04 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-03-29 17:58:37 -0400 |
| commit | 080b3c19a4ffe4677d7449880f4d0cea07182474 (patch) | |
| tree | 27705e68d54e29f2c9356d07fca45562b201f290 | |
| parent | 66b5552fc2dfbaa6445b1bdadd10c9305ce261bd (diff) | |
netpoll: Remove strong unnecessary assumptions about skbs
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>
| -rw-r--r-- | net/core/netpoll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 9fd88875faff..d44af2306f23 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
| @@ -112,7 +112,7 @@ static void queue_process(struct work_struct *work) | |||
| 112 | struct netdev_queue *txq; | 112 | struct netdev_queue *txq; |
| 113 | 113 | ||
| 114 | if (!netif_device_present(dev) || !netif_running(dev)) { | 114 | if (!netif_device_present(dev) || !netif_running(dev)) { |
| 115 | __kfree_skb(skb); | 115 | kfree_skb(skb); |
| 116 | continue; | 116 | continue; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| @@ -332,7 +332,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, | |||
| 332 | 332 | ||
| 333 | npinfo = rcu_dereference_bh(np->dev->npinfo); | 333 | npinfo = rcu_dereference_bh(np->dev->npinfo); |
| 334 | if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { | 334 | if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { |
| 335 | __kfree_skb(skb); | 335 | dev_kfree_skb_irq(skb); |
| 336 | return; | 336 | return; |
| 337 | } | 337 | } |
| 338 | 338 | ||
