[PATCH] Bluetooth: btusb: Add return error code

king posted 1 patch 2 years, 2 months ago
There is a newer version of this series
drivers/bluetooth/btusb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH] Bluetooth: btusb: Add return error code
Posted by king 2 years, 2 months ago
From: youwan Wang <youwan@nfschina.com>

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

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b8e9de887b5d..ec6bdc9687b1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2826,8 +2826,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;
-- 
2.25.1
Re: [PATCH] Bluetooth: btusb: Add return error code
Posted by Paul Menzel 2 years, 2 months ago
Dear Youwan,


Thank you for your patch.

It’d be great, if you versioned your patches. For example:

     git format-patch -v3 …

Am 19.10.23 um 04:39 schrieb king:
> From: youwan Wang <youwan@nfschina.com>
> 
> Signed-off-by: youwan Wang <youwan@nfschina.com>

It’d be great if you started the first name with an uppercase letter too.

Despite patch diff stats being small and the patch probably trivial, 
it’s common practice to state the motivation for the change nevertheless 
in the commit message body.

> ---
>   drivers/bluetooth/btusb.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index b8e9de887b5d..ec6bdc9687b1 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -2826,8 +2826,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;


Kind regards,

Paul