mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: add missing locking to protect against concurrent rx/status calls
According to the documentation, ieee80211_rx_list must not run concurrently with ieee80211_tx_status (or its variants). Cc: [email protected] Fixes: 88046b2c9f6d ("mt76: add support for reporting tx status with skb") Reported-by: Brian Coverstone <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -77,7 +77,9 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
|
||||
}
|
||||
|
||||
hw = mt76_tx_status_get_hw(dev, skb);
|
||||
spin_lock_bh(&dev->rx_lock);
|
||||
ieee80211_tx_status_ext(hw, &status);
|
||||
spin_unlock_bh(&dev->rx_lock);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
@@ -263,7 +265,9 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
|
||||
if (cb->pktid < MT_PACKET_ID_FIRST) {
|
||||
hw = mt76_tx_status_get_hw(dev, skb);
|
||||
status.sta = wcid_to_sta(wcid);
|
||||
spin_lock_bh(&dev->rx_lock);
|
||||
ieee80211_tx_status_ext(hw, &status);
|
||||
spin_unlock_bh(&dev->rx_lock);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user