net: ethernet: mediatek: use dev_kfree_skb_any instead of dev_kfree_skb
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 20 Oct 2016 17:00:32 +0000 (17:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Oct 2016 18:47:52 +0000 (14:47 -0400)
Replace dev_kfree_skb with dev_kfree_skb_any in mtk_start_xmit()
which can be called from hard irq context (netpoll) and from
other contexts. mtk_start_xmit() only frees skbs that it has
dropped.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_eth_soc.c

index 8f80e618ae59fef6291e9866ce8767e4cf401111..d71627417ea7de8d0102fa5e0de7053fb15f094a 100644 (file)
@@ -843,7 +843,7 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
 drop:
        spin_unlock(&eth->page_lock);
        stats->tx_dropped++;
-       dev_kfree_skb(skb);
+       dev_kfree_skb_any(skb);
        return NETDEV_TX_OK;
 }