Commit c9974ad4 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller

gianfar: Carefully free skbs in functions called by netpoll.

netpoll can call functions in hard irq context that are ordinarily
called in lesser contexts.  For those functions use dev_kfree_skb_any
and dev_consume_skb_any so skbs are freed safely from hard irq
context.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8ec2c02
...@@ -2192,13 +2192,13 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2192,13 +2192,13 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb_new = skb_realloc_headroom(skb, fcb_len); skb_new = skb_realloc_headroom(skb, fcb_len);
if (!skb_new) { if (!skb_new) {
dev->stats.tx_errors++; dev->stats.tx_errors++;
kfree_skb(skb); dev_kfree_skb_any(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
if (skb->sk) if (skb->sk)
skb_set_owner_w(skb_new, skb->sk); skb_set_owner_w(skb_new, skb->sk);
consume_skb(skb); dev_consume_skb_any(skb);
skb = skb_new; skb = skb_new;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment