public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: vt6656: Delete an unnecessary check before the macro call “dev_kfree_skb”
@ 2019-08-21 12:07 Markus Elfring
  2019-08-21 12:29 ` Quentin Deslandes
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-08-21 12:07 UTC (permalink / raw)
  To: devel, Forest Bond, Greg Kroah-Hartman, Quentin Deslandes
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 21 Aug 2019 13:56:35 +0200

The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/staging/vt6656/main_usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 856ba97aec4f..f57e890659aa 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -422,8 +422,7 @@ static void vnt_free_rx_bufs(struct vnt_private *priv)
 		}

 		/* deallocate skb */
-		if (rcb->skb)
-			dev_kfree_skb(rcb->skb);
+		dev_kfree_skb(rcb->skb);

 		kfree(rcb);
 	}
--
2.23.0


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

* Re: [PATCH] staging: vt6656: Delete an unnecessary check before the macro call “dev_kfree_skb”
  2019-08-21 12:07 [PATCH] staging: vt6656: Delete an unnecessary check before the macro call “dev_kfree_skb” Markus Elfring
@ 2019-08-21 12:29 ` Quentin Deslandes
  0 siblings, 0 replies; 2+ messages in thread
From: Quentin Deslandes @ 2019-08-21 12:29 UTC (permalink / raw)
  To: Markus Elfring
  Cc: devel@driverdev.osuosl.org, Forest Bond, Greg Kroah-Hartman, LKML,
	kernel-janitors@vger.kernel.org

On Wed, Aug 21, 2019 at 02:07:56PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 21 Aug 2019 13:56:35 +0200
> 
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/staging/vt6656/main_usb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index 856ba97aec4f..f57e890659aa 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -422,8 +422,7 @@ static void vnt_free_rx_bufs(struct vnt_private *priv)
>  		}
> 
>  		/* deallocate skb */
> -		if (rcb->skb)
> -			dev_kfree_skb(rcb->skb);
> +		dev_kfree_skb(rcb->skb);
> 
>  		kfree(rcb);
>  	}
> --
> 2.23.0
> 

Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>

Regards,
Quentin

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

end of thread, other threads:[~2019-08-21 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-21 12:07 [PATCH] staging: vt6656: Delete an unnecessary check before the macro call “dev_kfree_skb” Markus Elfring
2019-08-21 12:29 ` Quentin Deslandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox