diff mbox series

[BlueZ,v1,1/2] btdev: Fix crash on page_timeout

Message ID 20240215145227.782554-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/2] btdev: Fix crash on page_timeout | expand

Commit Message

Luiz Augusto von Dentz Feb. 15, 2024, 2:52 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If remote device cannot be found after page_timeout then the code shall
not proceed to call pending_conn_del.
---
 emulator/btdev.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 4c9f5d1811d4..139ab69b4029 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -1248,6 +1248,9 @@  static void conn_complete(struct btdev *btdev,
 	struct bt_hci_evt_conn_complete cc;
 	struct btdev *remote = find_btdev_by_bdaddr(bdaddr);
 
+	if (!remote)
+		return;
+
 	if (!status) {
 		struct btdev_conn *conn;