]> git.baikalelectronics.ru Git - kernel.git/commit
net: amd: lance: don't call dev_kfree_skb() under spin_lock_irqsave()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 8 Dec 2022 14:21:47 +0000 (22:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:15 +0000 (11:41 +0100)
commitc07d1b6cccbf66e9d07e7f181b10bd3ea4920844
tree834ad3629ab6b88f932c94ebbb03121c5c6b45a5
parent7cb94e05ce8e7fbc2da49c2986f79da00642db01
net: amd: lance: don't call dev_kfree_skb() under spin_lock_irqsave()

[ Upstream commit 3b8dd0e22c6356dca24ee116e0cc7cc5a2b1ea29 ]

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

It should use dev_kfree_skb_irq() or dev_consume_skb_irq() instead.
The difference between them is free reason, dev_kfree_skb_irq() means
the SKB is dropped in error and dev_consume_skb_irq() means the SKB
is consumed in normal.

In these two cases, dev_kfree_skb() is called consume the xmited SKB,
so replace it with dev_consume_skb_irq().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/amd/atarilance.c
drivers/net/ethernet/amd/lance.c