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

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>

authored by

Jun Miao and committed by
Marcel Holtmann
20a831f0 59da0b38

+10 -8
+10 -8
drivers/bluetooth/btusb.c
··· 2910 2910 /* Read the Intel supported features and if new exception formats 2911 2911 * supported, need to load the additional DDC config to enable. 2912 2912 */ 2913 - btintel_read_debug_features(hdev, &features); 2914 - 2915 - /* Set DDC mask for available debug features */ 2916 - btintel_set_debug_features(hdev, &features); 2913 + err = btintel_read_debug_features(hdev, &features); 2914 + if (!err) { 2915 + /* Set DDC mask for available debug features */ 2916 + btintel_set_debug_features(hdev, &features); 2917 + } 2917 2918 2918 2919 /* Read the Intel version information after loading the FW */ 2919 2920 err = btintel_read_version(hdev, &ver); ··· 3007 3006 /* Read the Intel supported features and if new exception formats 3008 3007 * supported, need to load the additional DDC config to enable. 3009 3008 */ 3010 - btintel_read_debug_features(hdev, &features); 3011 - 3012 - /* Set DDC mask for available debug features */ 3013 - btintel_set_debug_features(hdev, &features); 3009 + err = btintel_read_debug_features(hdev, &features); 3010 + if (!err) { 3011 + /* Set DDC mask for available debug features */ 3012 + btintel_set_debug_features(hdev, &features); 3013 + } 3014 3014 3015 3015 /* Read the Intel version information after loading the FW */ 3016 3016 err = btintel_read_version_tlv(hdev, &version);