Skip to content

Commit

Permalink
Bluetooth: ISO: consider right CIS when removing CIG at cleanup
Browse files Browse the repository at this point in the history
When looking for CIS blocking CIG removal, consider only the CIS with
the right CIG ID. Don't try to remove CIG with unset CIG ID.

Fixes: 26afbd8 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Pauli Virtanen authored and Luiz Augusto von Dentz committed Jun 6, 2023
1 parent fb92817 commit 31c5f91
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,8 @@ static void find_cis(struct hci_conn *conn, void *data)
{
struct iso_list_data *d = data;

/* Ignore broadcast */
if (!bacmp(&conn->dst, BDADDR_ANY))
/* Ignore broadcast or if CIG don't match */
if (!bacmp(&conn->dst, BDADDR_ANY) || d->cig != conn->iso_qos.ucast.cig)
return;

d->count++;
Expand All @@ -963,6 +963,9 @@ static void cis_cleanup(struct hci_conn *conn)
struct hci_dev *hdev = conn->hdev;
struct iso_list_data d;

if (conn->iso_qos.ucast.cig == BT_ISO_QOS_CIG_UNSET)
return;

memset(&d, 0, sizeof(d));
d.cig = conn->iso_qos.ucast.cig;

Expand Down

0 comments on commit 31c5f91

Please sign in to comment.