Netdev List
 help / color / mirror / Atom feed
* [PATCH] st/cw1200: cleanup the code a bit
@ 2022-05-17  1:41 Bernard Zhao
  2022-05-30  8:30 ` wifi: cw1200: " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Bernard Zhao @ 2022-05-17  1:41 UTC (permalink / raw)
  To: Solomon Peachy, Kalle Valo, David S. Miller, Jakub Kicinski,
	Paolo Abeni, linux-wireless, netdev, linux-kernel
  Cc: zhaojunkui2008, Bernard Zhao

Delete if NULL check before dev_kfree_skb call.
This change is to cleanup the code a bit.

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
 drivers/net/wireless/st/cw1200/bh.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/st/cw1200/bh.c b/drivers/net/wireless/st/cw1200/bh.c
index 10e019cddcc6..3b4ded2ac801 100644
--- a/drivers/net/wireless/st/cw1200/bh.c
+++ b/drivers/net/wireless/st/cw1200/bh.c
@@ -327,18 +327,12 @@ static int cw1200_bh_rx_helper(struct cw1200_common *priv,
 	if (WARN_ON(wsm_handle_rx(priv, wsm_id, wsm, &skb_rx)))
 		goto err;
 
-	if (skb_rx) {
-		dev_kfree_skb(skb_rx);
-		skb_rx = NULL;
-	}
+	dev_kfree_skb(skb_rx);
 
 	return 0;
 
 err:
-	if (skb_rx) {
-		dev_kfree_skb(skb_rx);
-		skb_rx = NULL;
-	}
+	dev_kfree_skb(skb_rx);
 	return -1;
 }
 
-- 
2.33.1


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

end of thread, other threads:[~2022-05-30  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17  1:41 [PATCH] st/cw1200: cleanup the code a bit Bernard Zhao
2022-05-30  8:30 ` wifi: cw1200: " Kalle Valo

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