From: Pauli Virtanen Date: Thu, 1 Jun 2023 06:34:44 +0000 (+0300) Subject: Bluetooth: ISO: don't try to remove CIG if there are bound CIS left X-Git-Tag: v6.6.17~4729^2~14^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c242c64a09e78349fb0a5f0a6f8076a3d7c0bb4;p=platform%2Fkernel%2Flinux-rpi.git Bluetooth: ISO: don't try to remove CIG if there are bound CIS left Consider existing BOUND & CONNECT state CIS to block CIG removal. Otherwise, under suitable timing conditions we may attempt to remove CIG while Create CIS is pending, which fails. Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections") Signed-off-by: Pauli Virtanen Signed-off-by: Luiz Augusto von Dentz --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 1f906f85..1ef952b 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -972,6 +972,8 @@ static void cis_cleanup(struct hci_conn *conn) /* Check if ISO connection is a CIS and remove CIG if there are * no other connections using it. */ + hci_conn_hash_list_state(hdev, find_cis, ISO_LINK, BT_BOUND, &d); + hci_conn_hash_list_state(hdev, find_cis, ISO_LINK, BT_CONNECT, &d); hci_conn_hash_list_state(hdev, find_cis, ISO_LINK, BT_CONNECTED, &d); if (d.count) return;