Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Alain Michaud and committed by
Marcel Holtmann
8a595619 bb0084ec

+2 -2
+2 -2
net/bluetooth/hci_core.c
··· 603 603 if (hdev->commands[8] & 0x01) 604 604 hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL); 605 605 606 - if (hdev->commands[18] & 0x02) 606 + if (hdev->commands[18] & 0x04) 607 607 hci_req_add(req, HCI_OP_READ_DEF_ERR_DATA_REPORTING, 0, NULL); 608 608 609 609 /* Some older Broadcom based Bluetooth 1.2 controllers do not ··· 844 844 /* Set erroneous data reporting if supported to the wideband speech 845 845 * setting value 846 846 */ 847 - if (hdev->commands[18] & 0x04) { 847 + if (hdev->commands[18] & 0x08) { 848 848 bool enabled = hci_dev_test_flag(hdev, 849 849 HCI_WIDEBAND_SPEECH_ENABLED); 850 850