diff options
author | Pauli Virtanen <pav@iki.fi> | 2023-08-05 19:08:42 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-08-11 11:57:54 -0700 |
commit | b5793de3cfaefef34a1fc9305c9fe3dbcd0ac792 (patch) | |
tree | 89635a48945dbb254aaf079e44e896dfa9e3c6e8 /include/net/bluetooth | |
parent | 66dee21524d9ac6461ec3052652b7bc0603ee0c5 (diff) | |
download | linux-b5793de3cfaefef34a1fc9305c9fe3dbcd0ac792.tar.gz linux-b5793de3cfaefef34a1fc9305c9fe3dbcd0ac792.tar.bz2 linux-b5793de3cfaefef34a1fc9305c9fe3dbcd0ac792.zip |
Bluetooth: hci_conn: avoid checking uninitialized CIG/CIS ids
The CIS/CIG ids of ISO connections are defined only when the connection
is unicast.
Fix the lookup functions to check for unicast first. Ensure CIG/CIS
IDs have valid value also in state BT_OPEN.
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index f4462c325e2a..c53d74236e3a 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1219,7 +1219,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_cis(struct hci_dev *hdev, rcu_read_lock(); list_for_each_entry_rcu(c, &h->list, list) { - if (c->type != ISO_LINK) + if (c->type != ISO_LINK || !bacmp(&c->dst, BDADDR_ANY)) continue; /* Match CIG ID if set */ @@ -1251,7 +1251,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_cig(struct hci_dev *hdev, rcu_read_lock(); list_for_each_entry_rcu(c, &h->list, list) { - if (c->type != ISO_LINK) + if (c->type != ISO_LINK || !bacmp(&c->dst, BDADDR_ANY)) continue; if (handle == c->iso_qos.ucast.cig) { |