Skip to content

Commit

Permalink
net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq()
Browse files Browse the repository at this point in the history
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: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Yang Yingliang <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Yang Yingliang authored and kuba-moo committed Dec 8, 2022
1 parent 5f4d487 commit 7d8c19b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/plip/plip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7d8c19b

Please sign in to comment.