Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: hci_event: Disconnect device when BIG sync is lost

When a BIG sync is lost, the device should be set to "disconnected".
This ensures symmetry with the ISO path setup, where the device is
marked as "connected" once the path is established. Without this
change, the device state remains inconsistent and may lead to a
memory leak.

Fixes: b2a5f2e1c127 ("Bluetooth: hci_event: Add support for handling LE BIG Sync Lost event")
Signed-off-by: Yang Li <yang.li@amlogic.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

authored by

Yang Li and committed by
Luiz Augusto von Dentz
55b9551f 15bf2c63

+8 -1
+5
net/bluetooth/hci_event.c
··· 7024 7024 { 7025 7025 struct hci_evt_le_big_sync_lost *ev = data; 7026 7026 struct hci_conn *bis, *conn; 7027 + bool mgmt_conn; 7027 7028 7028 7029 bt_dev_dbg(hdev, "big handle 0x%2.2x", ev->handle); 7029 7030 ··· 7043 7042 while ((bis = hci_conn_hash_lookup_big_state(hdev, ev->handle, 7044 7043 BT_CONNECTED, 7045 7044 HCI_ROLE_SLAVE))) { 7045 + mgmt_conn = test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &bis->flags); 7046 + mgmt_device_disconnected(hdev, &bis->dst, bis->type, bis->dst_type, 7047 + ev->reason, mgmt_conn); 7048 + 7046 7049 clear_bit(HCI_CONN_BIG_SYNC, &bis->flags); 7047 7050 hci_disconn_cfm(bis, ev->reason); 7048 7051 hci_conn_del(bis);
+3 -1
net/bluetooth/mgmt.c
··· 9705 9705 if (!mgmt_connected) 9706 9706 return; 9707 9707 9708 - if (link_type != ACL_LINK && link_type != LE_LINK) 9708 + if (link_type != ACL_LINK && 9709 + link_type != LE_LINK && 9710 + link_type != BIS_LINK) 9709 9711 return; 9710 9712 9711 9713 bacpy(&ev.addr.bdaddr, bdaddr);