rtlwifi: Delete unnecessary checks before the function call "kfree_skb"

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>
This commit is contained in:
Markus Elfring 2015-11-16 13:12:25 +01:00 committed by Kalle Valo
parent 6866a64a0f
commit 073d72f963
2 changed files with 2 additions and 5 deletions

View 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); spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
pskb = __skb_dequeue(&ring->queue); pskb = __skb_dequeue(&ring->queue);
if (pskb) kfree_skb(pskb);
kfree_skb(pskb);
/*this is wrong, fill_tx_cmddesc needs update*/ /*this is wrong, fill_tx_cmddesc needs update*/
pdesc = &ring->desc[0]; pdesc = &ring->desc[0];

View File

@ -318,9 +318,7 @@ bool rtl8723_cmd_send_packet(struct ieee80211_hw *hw,
ring = &rtlpci->tx_ring[BEACON_QUEUE]; ring = &rtlpci->tx_ring[BEACON_QUEUE];
pskb = __skb_dequeue(&ring->queue); pskb = __skb_dequeue(&ring->queue);
if (pskb) kfree_skb(pskb);
kfree_skb(pskb);
spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
pdesc = &ring->desc[0]; pdesc = &ring->desc[0];