Skip to content

Commit 8a59561

Browse files
Alain Michaudholtmann
authored andcommitted
Bluetooth: fix off by one in err_data_reporting cmd masks.
This change fixes the off by one error in the erroneous command bit masks which can lead to the erroneous data commands being sent to a controller that doesn't support them. Signed-off-by: Alain Michaud <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent bb0084e commit 8a59561

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bluetooth/hci_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt)
603603
if (hdev->commands[8] & 0x01)
604604
hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL);
605605

606-
if (hdev->commands[18] & 0x02)
606+
if (hdev->commands[18] & 0x04)
607607
hci_req_add(req, HCI_OP_READ_DEF_ERR_DATA_REPORTING, 0, NULL);
608608

609609
/* Some older Broadcom based Bluetooth 1.2 controllers do not
@@ -844,7 +844,7 @@ static int hci_init4_req(struct hci_request *req, unsigned long opt)
844844
/* Set erroneous data reporting if supported to the wideband speech
845845
* setting value
846846
*/
847-
if (hdev->commands[18] & 0x04) {
847+
if (hdev->commands[18] & 0x08) {
848848
bool enabled = hci_dev_test_flag(hdev,
849849
HCI_WIDEBAND_SPEECH_ENABLED);
850850

0 commit comments

Comments
 (0)