Commit 073d72f9 authored by Markus Elfring's avatar Markus Elfring Committed by Kalle Valo
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 6866a64a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1833,7 +1833,6 @@ 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);

	/*this is wrong, fill_tx_cmddesc needs update*/
+1 −3
Original line number Diff line number Diff line
@@ -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);

	spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);

	pdesc = &ring->desc[0];