gianfar: Carefully free skbs in functions called by netpoll.
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 11 Mar 2014 21:20:26 +0000 (14:20 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:40 +0000 (23:16 +0100)
commit c9974ad4aeb36003860100221a594f3c0ccc3f78 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: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: use only dev_kfree_skb() and not dev_consume_skb_any()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/freescale/gianfar.c

index fb9e7d3..b167e38 100644 (file)
@@ -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);
                if (!skb_new) {
                        dev->stats.tx_errors++;
-                       kfree_skb(skb);
+                       dev_kfree_skb_any(skb);
                        return NETDEV_TX_OK;
                }
-               kfree_skb(skb);
+               dev_kfree_skb_any(skb);
                skb = skb_new;
        }