Skip to content

Commit 03a6da9

Browse files
committed
Bluetooth: hci_event: Disconnect device when BIG sync is lost
JIRA: https://issues.redhat.com/browse/RHEL-107922 commit 55b9551 Author: Yang Li <yang.li@amlogic.com> Date: Wed Aug 20 10:16:17 2025 +0800 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: b2a5f2e ("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> Signed-off-by: David Marlin <dmarlin@redhat.com>
1 parent de3c36b commit 03a6da9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

net/bluetooth/hci_event.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7004,6 +7004,7 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,
70047004
{
70057005
struct hci_evt_le_big_sync_lost *ev = data;
70067006
struct hci_conn *bis, *conn;
7007+
bool mgmt_conn;
70077008

70087009
bt_dev_dbg(hdev, "big handle 0x%2.2x", ev->handle);
70097010

@@ -7022,6 +7023,10 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,
70227023
while ((bis = hci_conn_hash_lookup_big_state(hdev, ev->handle,
70237024
BT_CONNECTED,
70247025
HCI_ROLE_SLAVE))) {
7026+
mgmt_conn = test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &bis->flags);
7027+
mgmt_device_disconnected(hdev, &bis->dst, bis->type, bis->dst_type,
7028+
ev->reason, mgmt_conn);
7029+
70257030
clear_bit(HCI_CONN_BIG_SYNC, &bis->flags);
70267031
hci_disconn_cfm(bis, ev->reason);
70277032
hci_conn_del(bis);

net/bluetooth/mgmt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9705,7 +9705,9 @@ void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
97059705
if (!mgmt_connected)
97069706
return;
97079707

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)
97099711
return;
97109712

97119713
bacpy(&ev.addr.bdaddr, bdaddr);

0 commit comments

Comments
 (0)