linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/wlan-ng/hfa384x: Delete an unnecessary check before the macro call “dev_kfree_skb”
@ 2019-08-21 12:40 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2019-08-21 12:40 UTC (permalink / raw)
  To: devel, Branden Bonaby, Greg Kroah-Hartman, Himadri Pandya,
	Nishka Dasgupta, Tim Collier
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 21 Aug 2019 14:30:30 +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/wlan-ng/hfa384x_usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 28d372a0663a..54f631c4155a 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3070,9 +3070,7 @@ static void hfa384x_usbin_callback(struct urb *urb)
 	}			/* switch */

 exit:
-
-	if (skb)
-		dev_kfree_skb(skb);
+	dev_kfree_skb(skb);
 }

 /*----------------------------------------------------------------
--
2.23.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-21 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 12:40 [PATCH] staging/wlan-ng/hfa384x: Delete an unnecessary check before the macro call “dev_kfree_skb” Markus Elfring

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