]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: ISO: use correct CIS order in Set CIG Parameters event
authorPauli Virtanen <pav@iki.fi>
Thu, 1 Jun 2023 06:34:45 +0000 (09:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2023 09:16:47 +0000 (11:16 +0200)
commit99cba97ad0b7c5fbc57ed55fc637377cd9d8e126
tree25bf756ed29f3234fe1c638c0af68e2dafaf2254
parentc329dd3846361cfa521b85112ca89dafff1b7c03
Bluetooth: ISO: use correct CIS order in Set CIG Parameters event

[ Upstream commit 71e9588435c38112d6a8686d3d8e7cc1de8fe22c ]

The order of CIS handle array in Set CIG Parameters response shall match
the order of the CIS_ID array in the command (Core v5.3 Vol 4 Part E Sec
7.8.97).  We send CIS_IDs mainly in the order of increasing CIS_ID (but
with "last" CIS first if it has fixed CIG_ID).  In handling of the
reply, we currently assume this is also the same as the order of
hci_conn in hdev->conn_hash, but that is not true.

Match the correct hci_conn to the correct handle by matching them based
on the CIG+CIS combination.  The CIG+CIS combination shall be unique for
ISO_LINK hci_conn at state >= BT_BOUND, which we maintain in
hci_le_set_cig_params.

Fixes: 26afbd826ee3 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_event.c