Commit 129fa60
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: baac627 ("Bluetooth: btusb: handle mSBC audio over USB Endpoints")
Signed-off-by: Pengpeng Hou <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>1 parent 25f420a commit 129fa60
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2376 | 2376 | | |
2377 | 2377 | | |
2378 | 2378 | | |
| 2379 | + | |
2379 | 2380 | | |
2380 | | - | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
2381 | 2384 | | |
2382 | 2385 | | |
2383 | 2386 | | |
| |||
0 commit comments