Commit c2cfd3a7 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Ben Hutchings

gianfar: Carefully free skbs in functions called by netpoll.

commit c9974ad4 upstream.

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>
[bwh: Backported to 3.2: use only dev_kfree_skb() and not dev_consume_skb_any()]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 8fdccc87
...@@ -2092,10 +2092,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2092,10 +2092,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb_new = skb_realloc_headroom(skb, GMAC_FCB_LEN); skb_new = skb_realloc_headroom(skb, GMAC_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;
} }
kfree_skb(skb); dev_kfree_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