Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: virtio_bt: unregister HCI device on open failure
@ 2026-06-24  8:43 Haoxiang Li
  2026-06-24  9:10 ` Paul Menzel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Haoxiang Li @ 2026-06-24  8:43 UTC (permalink / raw)
  To: marcel, luiz.dentz, yangyingliang, mst, error27
  Cc: linux-bluetooth, linux-kernel, Haoxiang Li, stable

virtbt_probe() registers the HCI device before calling
virtbt_open_vdev(). If opening the virtio Bluetooth
device fails, the error path frees the HCI device without
unregistering it.

Fixes: dc65b4b0f90a ("Bluetooth: virtio_bt: fix device removal")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
 drivers/bluetooth/virtio_bt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
index 140ab55c9fc5..bf6827431bb8 100644
--- a/drivers/bluetooth/virtio_bt.c
+++ b/drivers/bluetooth/virtio_bt.c
@@ -397,6 +397,7 @@ static int virtbt_probe(struct virtio_device *vdev)
 	return 0;
 
 open_failed:
+	hci_unregister_dev(hdev);
 	hci_free_dev(hdev);
 failed:
 	vdev->config->del_vqs(vdev);
-- 
2.25.1


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

end of thread, other threads:[~2026-06-24 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24  8:43 [PATCH] Bluetooth: virtio_bt: unregister HCI device on open failure Haoxiang Li
2026-06-24  9:10 ` Paul Menzel
2026-06-24 10:56 ` Dan Carpenter
2026-06-24 11:57 ` 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