linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btusb: Fix a unspported condition to set available debug features
@ 2021-07-09 13:46 Jun Miao
  2021-07-22 14:17 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Jun Miao @ 2021-07-09 13:46 UTC (permalink / raw)
  To: matthias.bgg
  Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
	linux-arm-kernel

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>
---
 drivers/bluetooth/btusb.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 7f6ba2c975ed..a3c027d17745 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2889,10 +2889,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);
@@ -2985,10 +2986,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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: btusb: Fix a unspported condition to set available debug features
  2021-07-09 13:46 [PATCH] Bluetooth: btusb: Fix a unspported condition to set available debug features Jun Miao
@ 2021-07-22 14:17 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2021-07-22 14:17 UTC (permalink / raw)
  To: Jun Miao
  Cc: matthias.bgg, Johan Hedberg, Luiz Augusto von Dentz,
	Bluetooth Kernel Mailing List, linux-kernel, linux-arm-kernel

Hi Jun,

> 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>
> ---
> drivers/bluetooth/btusb.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-22 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 13:46 [PATCH] Bluetooth: btusb: Fix a unspported condition to set available debug features Jun Miao
2021-07-22 14:17 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).