All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Bluetooth: don't call kfree_skb() under spin_lock_irqsave()
@ 2022-12-07  2:18 Yang Yingliang
  2022-12-07  2:18 ` [PATCH v2 1/6] Bluetooth: hci_qca: " Yang Yingliang
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Yang Yingliang @ 2022-12-07  2:18 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, yangyingliang

It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled. This patchset is
replace kfree_skb() with dev_kfree_skb_irq() under
spin_lock_irqsave().

v1 -> v2:
  Replace kfree_skb() with dev_kfree_skb_irq().

Yang Yingliang (6):
  Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave()
  Bluetooth: hci_ll: don't call kfree_skb() under spin_lock_irqsave()
  Bluetooth: hci_h5: don't call kfree_skb() under spin_lock_irqsave()
  Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave()
  Bluetooth: hci_core: don't call kfree_skb() under spin_lock_irqsave()
  Bluetooth: RFCOMM: don't call kfree_skb() under spin_lock_irqsave()

 drivers/bluetooth/hci_bcsp.c | 2 +-
 drivers/bluetooth/hci_h5.c   | 2 +-
 drivers/bluetooth/hci_ll.c   | 2 +-
 drivers/bluetooth/hci_qca.c  | 2 +-
 net/bluetooth/hci_core.c     | 2 +-
 net/bluetooth/rfcomm/core.c  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 1/6] Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave()
@ 2022-12-05 15:09 Yang Yingliang
  2022-12-05 15:56 ` Bluetooth: " bluez.test.bot
  0 siblings, 1 reply; 10+ messages in thread
From: Yang Yingliang @ 2022-12-05 15:09 UTC (permalink / raw)
  To: marcel, johan.hedberg, luiz.dentz; +Cc: linux-bluetooth, yangyingliang

It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled. Call it after the
spin_unlock_irqrestore().

Fixes: 0ff252c1976d ("Bluetooth: hciuart: Add support QCA chipset for UART")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/bluetooth/hci_qca.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 8df11016fd51..69c5cedda6d2 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -912,8 +912,9 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb)
 	default:
 		BT_ERR("Illegal tx state: %d (losing packet)",
 		       qca->tx_ibs_state);
+		spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
 		kfree_skb(skb);
-		break;
+		return 0;
 	}
 
 	spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-07 21:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-07  2:18 [PATCH v2 0/6] Bluetooth: don't call kfree_skb() under spin_lock_irqsave() Yang Yingliang
2022-12-07  2:18 ` [PATCH v2 1/6] Bluetooth: hci_qca: " Yang Yingliang
2022-12-07  2:41   ` Bluetooth: " bluez.test.bot
2022-12-07  2:18 ` [PATCH v2 2/6] Bluetooth: hci_ll: " Yang Yingliang
2022-12-07  2:18 ` [PATCH v2 3/6] Bluetooth: hci_h5: " Yang Yingliang
2022-12-07  2:18 ` [PATCH v2 4/6] Bluetooth: hci_bcsp: " Yang Yingliang
2022-12-07  2:18 ` [PATCH v2 5/6] Bluetooth: hci_core: " Yang Yingliang
2022-12-07  2:18 ` [PATCH v2 6/6] Bluetooth: RFCOMM: " Yang Yingliang
2022-12-07 21:20 ` [PATCH v2 0/6] Bluetooth: " patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2022-12-05 15:09 [PATCH 1/6] Bluetooth: hci_qca: " Yang Yingliang
2022-12-05 15:56 ` Bluetooth: " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.