rtlwifi: Delete unnecessary checks before the function call "kfree_skb"
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 16 Nov 2015 12:12:25 +0000 (13:12 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 26 Nov 2015 12:55:27 +0000 (14:55 +0200)
The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtlwifi/core.c
drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c

index c925a4dff5995b6934bfc5edcb28a45ec8bbe4c7..4ae421ef30d94f4f8bc93d85645eeda4548ba835 100644 (file)
@@ -1833,8 +1833,7 @@ bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb)
 
        spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
        pskb = __skb_dequeue(&ring->queue);
-       if (pskb)
-               kfree_skb(pskb);
+       kfree_skb(pskb);
 
        /*this is wrong, fill_tx_cmddesc needs update*/
        pdesc = &ring->desc[0];
index a2f5e89bedfed333b6f157e431b61239bd6c593c..6e518625edbe774e6b996d6b5739d563b7e8d35e 100644 (file)
@@ -318,9 +318,7 @@ bool rtl8723_cmd_send_packet(struct ieee80211_hw *hw,
        ring = &rtlpci->tx_ring[BEACON_QUEUE];
 
        pskb = __skb_dequeue(&ring->queue);
-       if (pskb)
-               kfree_skb(pskb);
-
+       kfree_skb(pskb);
        spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
 
        pdesc = &ring->desc[0];