diff mbox series

[v3] Bluetooth: btusb: Set error code in btusb_mtk_hci_wmt_sync()

Message ID 20240313074358.427090-1-youwan@nfschina.com
State New
Headers show
Series [v3] Bluetooth: btusb: Set error code in btusb_mtk_hci_wmt_sync() | expand

Commit Message

Youwan Wang March 13, 2024, 7:43 a.m. UTC
Convenient to check if the function was executed successfully
and know the specific error location in the code.

Signed-off-by: Youwan Wang <youwan@nfschina.com>
---
 drivers/bluetooth/btusb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index d793dcd06687..a7244a8a5b7c 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2824,8 +2824,10 @@  static int btusb_mtk_hci_wmt_sync(struct hci_dev *hdev,
 		goto err_free_wc;
 	}
 
-	if (data->evt_skb == NULL)
+	if (data->evt_skb == NULL) {
+		err = -ENOBUFS;
 		goto err_free_wc;
+	}
 
 	/* Parse and handle the return WMT event */
 	wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data;