From: Bernard Zhao Date: Tue, 17 May 2022 01:41:36 +0000 (-0700) Subject: wifi: cw1200: cleanup the code a bit X-Git-Tag: v6.6.17~6916^2~381^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d092de2c28dcf752890252dedefed98f00a631fe;p=platform%2Fkernel%2Flinux-rpi.git wifi: cw1200: cleanup the code a bit Delete if NULL check before dev_kfree_skb call. This change is to cleanup the code a bit. Signed-off-by: Bernard Zhao Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220517014136.410450-1-bernard@vivo.com --- diff --git a/drivers/net/wireless/st/cw1200/bh.c b/drivers/net/wireless/st/cw1200/bh.c index 10e019c..3b4ded2 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; }