Commit f07fadcb authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller
Browse files

net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave()



It is not allowed to call kfree_skb() or consume_skb() from hardware
interrupt context or with hardware interrupts being disabled.

In this case, the lock is used to protected 'bp', so we can move
dev_kfree_skb() after the spin_unlock_irqrestore().

Fixes: 47964174 ("dnet: Dave DNET ethernet controller driver (updated)")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d1678bf4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -550,11 +550,11 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev)


	skb_tx_timestamp(skb);
	skb_tx_timestamp(skb);


	spin_unlock_irqrestore(&bp->lock, flags);

	/* free the buffer */
	/* free the buffer */
	dev_kfree_skb(skb);
	dev_kfree_skb(skb);


	spin_unlock_irqrestore(&bp->lock, flags);

	return NETDEV_TX_OK;
	return NETDEV_TX_OK;
}
}