Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_core: Explicitly kfree_skb() HCI_DRV_PKT and HCI_DIAG_PKT frames
@ 2026-07-19 20:29 Zijun Hu
  2026-07-19 21:44 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Zijun Hu @ 2026-07-19 20:29 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Zijun Hu, linux-bluetooth, linux-kernel, Zijun Hu

In hci_rx_work(), HCI_DRV_PKT and HCI_DIAG_PKT rely on the default
case to free them, and cause:

- They get mixed in with unknown packet types (default case).
- It is not clear which packet types the function is handling.

Fix by giving both their own case that kfree_skb()s explicitly.

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
 net/bluetooth/hci_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index d1e78ae7728e..1e324c05af24 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -4057,6 +4057,14 @@ static void hci_rx_work(struct work_struct *work)
 			hci_isodata_packet(hdev, skb);
 			break;
 
+		case HCI_DRV_PKT:
+			kfree_skb(skb);
+			break;
+
+		case HCI_DIAG_PKT:
+			kfree_skb(skb);
+			break;
+
 		default:
 			kfree_skb(skb);
 			break;

---
base-commit: bd8bee79e1fa8db2d587733f8b6fd9597b04d6e3
change-id: 20260719-fix_hci_rx_work-f03dd49d8ef8

Best regards,
-- 
Zijun Hu <zijun.hu@oss.qualcomm.com>


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

end of thread, other threads:[~2026-07-19 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-19 20:29 [PATCH] Bluetooth: hci_core: Explicitly kfree_skb() HCI_DRV_PKT and HCI_DIAG_PKT frames Zijun Hu
2026-07-19 21:44 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox