Skip to content

Commit

Permalink
rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb
Browse files Browse the repository at this point in the history
It is not allowed to call kfree_skb() from hardware interrupt
context or with interrupts being disabled, spin_lock_irqsave()
make sure always in irq disable context. So the kfree_skb()
should be replaced with dev_kfree_skb_irq().

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Wei Yongjun authored and Kalle Valo committed Nov 17, 2016
1 parent 7fc1503 commit e496561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/realtek/rtlwifi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,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);
kfree_skb(pskb);
dev_kfree_skb_irq(pskb);

/*this is wrong, fill_tx_cmddesc needs update*/
pdesc = &ring->desc[0];
Expand Down

0 comments on commit e496561

Please sign in to comment.