Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22b68b93 authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo
Browse files

rtlwifi: Fix kernel oops introduced with commit e4965614



With commit e4965614 {"rtlwifi: Use dev_kfree_skb_irq instead of
kfree_skb"), the method used to free an skb was changed because the
kfree_skb() was inside a spinlock. What was forgotten is that kfree_skb()
guards against a NULL value for the argument. Routine dev_kfree_skb_irq()
does not, and a test is needed to prevent kernel panics.

Fixes: e4965614 ("rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb")
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> # 4.9+
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent d1f1c0e2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1829,6 +1829,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)
		dev_kfree_skb_irq(pskb);

	/*this is wrong, fill_tx_cmddesc needs update*/