linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFC: nfcmrvl: add unanchor after anchor
@ 2021-11-04  8:55 Jiasheng Jiang
  2021-11-04 11:28 ` Krzysztof Kozlowski
  2021-11-06  2:48 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Jiasheng Jiang @ 2021-11-04  8:55 UTC (permalink / raw)
  To: krzysztof.kozlowski, yashsri421, davem, rdunlap
  Cc: netdev, linux-kernel, Jiasheng Jiang

In the error path, the anchored urb is unanchored.
But in the successful path, the anchored urb is not.
Therefore, it might be better to add unanchor().

Fixes: f26e30c ("NFC: nfcmrvl: Initial commit for Marvell NFC driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/nfc/nfcmrvl/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nfcmrvl/usb.c b/drivers/nfc/nfcmrvl/usb.c
index bcd563c..f8ae517 100644
--- a/drivers/nfc/nfcmrvl/usb.c
+++ b/drivers/nfc/nfcmrvl/usb.c
@@ -146,9 +146,9 @@ nfcmrvl_submit_bulk_urb(struct nfcmrvl_usb_drv_data *drv_data, gfp_t mem_flags)
 		if (err != -EPERM && err != -ENODEV)
 			nfc_err(&drv_data->udev->dev,
 				"urb %p submission failed (%d)\n", urb, -err);
-		usb_unanchor_urb(urb);
 	}
 
+	usb_unanchor_urb(urb);
 	usb_free_urb(urb);
 
 	return err;
-- 
2.7.4


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

* Re: [PATCH] NFC: nfcmrvl: add unanchor after anchor
  2021-11-04  8:55 [PATCH] NFC: nfcmrvl: add unanchor after anchor Jiasheng Jiang
@ 2021-11-04 11:28 ` Krzysztof Kozlowski
  2021-11-06  2:48 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-11-04 11:28 UTC (permalink / raw)
  To: Jiasheng Jiang, yashsri421, davem, rdunlap; +Cc: netdev, linux-kernel

On 04/11/2021 09:55, Jiasheng Jiang wrote:
> In the error path, the anchored urb is unanchored.
> But in the successful path, the anchored urb is not.
> Therefore, it might be better to add unanchor().
> 
> Fixes: f26e30c ("NFC: nfcmrvl: Initial commit for Marvell NFC driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/nfc/nfcmrvl/usb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nfc/nfcmrvl/usb.c b/drivers/nfc/nfcmrvl/usb.c
> index bcd563c..f8ae517 100644
> --- a/drivers/nfc/nfcmrvl/usb.c
> +++ b/drivers/nfc/nfcmrvl/usb.c
> @@ -146,9 +146,9 @@ nfcmrvl_submit_bulk_urb(struct nfcmrvl_usb_drv_data *drv_data, gfp_t mem_flags)
>  		if (err != -EPERM && err != -ENODEV)
>  			nfc_err(&drv_data->udev->dev,
>  				"urb %p submission failed (%d)\n", urb, -err);
> -		usb_unanchor_urb(urb);
>  	}
>  
> +	usb_unanchor_urb(urb);
>  	usb_free_urb(urb);
>  
>  	return err;
> 

Why only this place in the driver? And why only this driver - some
others miss it as well (e.g. btusb which was probably the template for
this one). Are you sure it is a correct patch? Did you test it?

Best regards,
Krzysztof

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

* Re: [PATCH] NFC: nfcmrvl: add unanchor after anchor
  2021-11-04  8:55 [PATCH] NFC: nfcmrvl: add unanchor after anchor Jiasheng Jiang
  2021-11-04 11:28 ` Krzysztof Kozlowski
@ 2021-11-06  2:48 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2021-11-06  2:48 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: krzysztof.kozlowski, yashsri421, davem, rdunlap, netdev, linux-kernel

On Thu,  4 Nov 2021 08:55:41 +0000 Jiasheng Jiang wrote:
> In the error path, the anchored urb is unanchored.
> But in the successful path, the anchored urb is not.
> Therefore, it might be better to add unanchor().
> 
> Fixes: f26e30c ("NFC: nfcmrvl: Initial commit for Marvell NFC driver")

Apart from answering Krzysztof's comment please also mend the Fixes tag.
The hash should be at least 12 digits long.

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

end of thread, other threads:[~2021-11-06  2:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04  8:55 [PATCH] NFC: nfcmrvl: add unanchor after anchor Jiasheng Jiang
2021-11-04 11:28 ` Krzysztof Kozlowski
2021-11-06  2:48 ` Jakub Kicinski

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).