Skip to content

Commit 3b062a4

Browse files
Vudentzgregkh
authored andcommitted
Bluetooth: hci_sync: Fix use HCI_OP_LE_READ_BUFFER_SIZE_V2
commit 3a4d29b upstream. Don't try to use HCI_OP_LE_READ_BUFFER_SIZE_V2 if controller don't support ISO channels, but in order to check if ISO channels are supported HCI_OP_LE_READ_LOCAL_FEATURES needs to be done earlier so the features bits can be checked on hci_le_read_buffer_size_sync. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216817 Fixes: c1631db ("Bluetooth: hci_sync: Fix hci_read_buffer_size_sync") Cc: [email protected] # 6.1 Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4e18618 commit 3b062a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/bluetooth/hci_sync.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@ static const struct hci_init_stage hci_init2[] = {
35543554
static int hci_le_read_buffer_size_sync(struct hci_dev *hdev)
35553555
{
35563556
/* Use Read LE Buffer Size V2 if supported */
3557-
if (hdev->commands[41] & 0x20)
3557+
if (iso_capable(hdev) && hdev->commands[41] & 0x20)
35583558
return __hci_cmd_sync_status(hdev,
35593559
HCI_OP_LE_READ_BUFFER_SIZE_V2,
35603560
0, NULL, HCI_CMD_TIMEOUT);
@@ -3579,10 +3579,10 @@ static int hci_le_read_supported_states_sync(struct hci_dev *hdev)
35793579

35803580
/* LE Controller init stage 2 command sequence */
35813581
static const struct hci_init_stage le_init2[] = {
3582-
/* HCI_OP_LE_READ_BUFFER_SIZE */
3583-
HCI_INIT(hci_le_read_buffer_size_sync),
35843582
/* HCI_OP_LE_READ_LOCAL_FEATURES */
35853583
HCI_INIT(hci_le_read_local_features_sync),
3584+
/* HCI_OP_LE_READ_BUFFER_SIZE */
3585+
HCI_INIT(hci_le_read_buffer_size_sync),
35863586
/* HCI_OP_LE_READ_SUPPORTED_STATES */
35873587
HCI_INIT(hci_le_read_supported_states_sync),
35883588
{}

0 commit comments

Comments
 (0)