diff mbox series

NFC: nfcmrvl: add unanchor after anchor

Message ID 1636016141-3645490-1-git-send-email-jiasheng@iscas.ac.cn (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series NFC: nfcmrvl: add unanchor after anchor | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiasheng Jiang Nov. 4, 2021, 8:55 a.m. UTC
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(-)

Comments

Krzysztof Kozlowski Nov. 4, 2021, 11:28 a.m. UTC | #1
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
Jakub Kicinski Nov. 6, 2021, 2:48 a.m. UTC | #2
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.
diff mbox series

Patch

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;