aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorJun Miao <jun.miao@windriver.com>2021-07-09 21:46:25 +0800
committerMarcel Holtmann <marcel@holtmann.org>2021-07-22 16:16:19 +0200
commit20a831f04f1526f2c3442efd3dece8630216b5d2 (patch)
tree87343a381a0efe1c162cb2f57498da488e59634f /drivers/bluetooth
parentBluetooth: sco: prevent information leak in sco_conn_defer_accept() (diff)
downloadlinux-dev-20a831f04f1526f2c3442efd3dece8630216b5d2.tar.xz
linux-dev-20a831f04f1526f2c3442efd3dece8630216b5d2.zip
Bluetooth: btusb: Fix a unspported condition to set available debug features
When reading the support debug features failed, there are not available features init. Continue to set the debug features is illogical, we should skip btintel_set_debug_features(), even if check it by "if (!features)". Fixes: c453b10c2b28 ("Bluetooth: btusb: Configure Intel debug feature based on available support") Signed-off-by: Jun Miao <jun.miao@windriver.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btusb.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index edfa5a31a529..5969860eb87d 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2910,10 +2910,11 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
/* Read the Intel supported features and if new exception formats
* supported, need to load the additional DDC config to enable.
*/
- btintel_read_debug_features(hdev, &features);
-
- /* Set DDC mask for available debug features */
- btintel_set_debug_features(hdev, &features);
+ err = btintel_read_debug_features(hdev, &features);
+ if (!err) {
+ /* Set DDC mask for available debug features */
+ btintel_set_debug_features(hdev, &features);
+ }
/* Read the Intel version information after loading the FW */
err = btintel_read_version(hdev, &ver);
@@ -3006,10 +3007,11 @@ static int btusb_setup_intel_newgen(struct hci_dev *hdev)
/* Read the Intel supported features and if new exception formats
* supported, need to load the additional DDC config to enable.
*/
- btintel_read_debug_features(hdev, &features);
-
- /* Set DDC mask for available debug features */
- btintel_set_debug_features(hdev, &features);
+ err = btintel_read_debug_features(hdev, &features);
+ if (!err) {
+ /* Set DDC mask for available debug features */
+ btintel_set_debug_features(hdev, &features);
+ }
/* Read the Intel version information after loading the FW */
err = btintel_read_version_tlv(hdev, &version);