Commit 0c152867 authored by Yang Yingliang's avatar Yang Yingliang Committed by Kalle Valo

wifi: iwlegacy: common: don't call dev_kfree_skb() under spin_lock_irqsave()

It is not allowed to call consume_skb() from hardware interrupt context
or with interrupts being disabled. So replace dev_kfree_skb() with
dev_consume_skb_irq() under spin_lock_irqsave(). Compile tested only.

Fixes: 4bc85c13 ("Revert "iwlwifi: split the drivers for agn and legacy devices 3945/4965"")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Acked-by: default avatarStanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221207144013.70210-1-yangyingliang@huawei.com
parent 313950c2
...@@ -5174,7 +5174,7 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -5174,7 +5174,7 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
memset(&il->current_ht_config, 0, sizeof(struct il_ht_config)); memset(&il->current_ht_config, 0, sizeof(struct il_ht_config));
/* new association get rid of ibss beacon skb */ /* new association get rid of ibss beacon skb */
dev_kfree_skb(il->beacon_skb); dev_consume_skb_irq(il->beacon_skb);
il->beacon_skb = NULL; il->beacon_skb = NULL;
il->timestamp = 0; il->timestamp = 0;
...@@ -5293,7 +5293,7 @@ il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -5293,7 +5293,7 @@ il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
} }
spin_lock_irqsave(&il->lock, flags); spin_lock_irqsave(&il->lock, flags);
dev_kfree_skb(il->beacon_skb); dev_consume_skb_irq(il->beacon_skb);
il->beacon_skb = skb; il->beacon_skb = skb;
timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
......
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