2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

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: b2a5f2e1c1 ("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>
This commit is contained in:
Yang Li 2025-08-20 10:16:17 +08:00 committed by Luiz Augusto von Dentz
parent 15bf2c6391
commit 55b9551fcd
2 changed files with 8 additions and 1 deletions

View File

@ -7024,6 +7024,7 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,
{ {
struct hci_evt_le_big_sync_lost *ev = data; struct hci_evt_le_big_sync_lost *ev = data;
struct hci_conn *bis, *conn; struct hci_conn *bis, *conn;
bool mgmt_conn;
bt_dev_dbg(hdev, "big handle 0x%2.2x", ev->handle); bt_dev_dbg(hdev, "big handle 0x%2.2x", ev->handle);
@ -7042,6 +7043,10 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,
while ((bis = hci_conn_hash_lookup_big_state(hdev, ev->handle, while ((bis = hci_conn_hash_lookup_big_state(hdev, ev->handle,
BT_CONNECTED, BT_CONNECTED,
HCI_ROLE_SLAVE))) { HCI_ROLE_SLAVE))) {
mgmt_conn = test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &bis->flags);
mgmt_device_disconnected(hdev, &bis->dst, bis->type, bis->dst_type,
ev->reason, mgmt_conn);
clear_bit(HCI_CONN_BIG_SYNC, &bis->flags); clear_bit(HCI_CONN_BIG_SYNC, &bis->flags);
hci_disconn_cfm(bis, ev->reason); hci_disconn_cfm(bis, ev->reason);
hci_conn_del(bis); hci_conn_del(bis);

View File

@ -9705,7 +9705,9 @@ void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
if (!mgmt_connected) if (!mgmt_connected)
return; return;
if (link_type != ACL_LINK && link_type != LE_LINK) if (link_type != ACL_LINK &&
link_type != LE_LINK &&
link_type != BIS_LINK)
return; return;
bacpy(&ev.addr.bdaddr, bdaddr); bacpy(&ev.addr.bdaddr, bdaddr);