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

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
......@@ -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*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment