]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
Bluetooth: btusb: clamp SCO altsetting table indices
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Wed, 25 Mar 2026 00:42:45 +0000 (08:42 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 25 Mar 2026 19:32:55 +0000 (15:32 -0400)
commit129fa608b6ad08b8ab7178eeb2ec272c993aaccc
treefdf49cbf29a7dd2a4b18a81fb53beb621711ae72
parent25f420a0d4cfd61d3d23ec4b9c56d9f443d91377
Bluetooth: btusb: clamp SCO altsetting table indices

btusb_work() maps the number of active SCO links to USB alternate
settings through a three-entry lookup table when CVSD traffic uses
transparent voice settings. The lookup currently indexes alts[] with
data->sco_num - 1 without first constraining sco_num to the number of
available table entries.

While the table only defines alternate settings for up to three SCO
links, data->sco_num comes from hci_conn_num() and is used directly.
Cap the lookup to the last table entry before indexing it so the
driver keeps selecting the highest supported alternate setting without
reading past alts[].

Fixes: baac6276c0a9 ("Bluetooth: btusb: handle mSBC audio over USB Endpoints")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btusb.c