diff mbox series

[net,v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()

Message ID 20221207015310.2984909-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 7d8c19bfc8ff3f78e5337107ca9246327fcb6b45
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 3 maintainers not CCed: bigeasy@linutronix.de fw@strlen.de socketcan@hartkopp.net
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Dec. 7, 2022, 1:53 a.m. UTC
It is not allowed to call kfree_skb() or consume_skb() from
hardware interrupt context or with interrupts being disabled.
So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq()
and dev_consume_skb_irq() under spin_lock_irq().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
v1 -> v2:
  Add a fix tag.
---
 drivers/net/plip/plip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jiri Pirko Dec. 7, 2022, 1:54 p.m. UTC | #1
Wed, Dec 07, 2022 at 02:53:10AM CET, yangyingliang@huawei.com wrote:
>It is not allowed to call kfree_skb() or consume_skb() from
>hardware interrupt context or with interrupts being disabled.
>So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq()
>and dev_consume_skb_irq() under spin_lock_irq().
>
>Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>

I wonder if anyone is actually using PLIP these days :)
patchwork-bot+netdevbpf@kernel.org Dec. 8, 2022, 4:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 7 Dec 2022 09:53:10 +0800 you wrote:
> It is not allowed to call kfree_skb() or consume_skb() from
> hardware interrupt context or with interrupts being disabled.
> So replace kfree_skb/dev_kfree_skb() with dev_kfree_skb_irq()
> and dev_consume_skb_irq() under spin_lock_irq().
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net,v2] net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()
    https://git.kernel.org/netdev/net/c/7d8c19bfc8ff

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index c8791e9b451d..40ce8abe6999 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -450,12 +450,12 @@  plip_bh_timeout_error(struct net_device *dev, struct net_local *nl,
 	}
 	rcv->state = PLIP_PK_DONE;
 	if (rcv->skb) {
-		kfree_skb(rcv->skb);
+		dev_kfree_skb_irq(rcv->skb);
 		rcv->skb = NULL;
 	}
 	snd->state = PLIP_PK_DONE;
 	if (snd->skb) {
-		dev_kfree_skb(snd->skb);
+		dev_consume_skb_irq(snd->skb);
 		snd->skb = NULL;
 	}
 	spin_unlock_irq(&nl->lock);