mt76: dma: reset q->rx_head on rx reset
Subsystems (2)
Felix Fietkau
maintainerPATCH 1/2 mt76: dma: reset q->rx_head on rx reset
Fixes rx of the first frame if a fragmented rx was interrupted by the reset
Signed-off-by Felix Fietkau <[email protected]>
--- drivers/net/wireless/mediatek/mt76/dma.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/mediatek/mt76/dma.c +6 -0
@@ -431,6 +431,12 @@ mt76_dma_rx_reset(struct mt76_dev *dev, enum mt76_rxq_id qid)mt76_dma_rx_cleanup (dev, q);mt76_dma_sync_idx (dev, q);mt76_dma_rx_fill (dev, q); + +if (!q->rx_head) +return ; + +dev_kfree_skb (q->rx_head); + q->rx_head =NULL ; } static void
Signature · 1 line
2.17.0
Felix Fietkau
maintainerPATCH 2/2 mt76: stop rx aggregation on station removal
Fixes use-after-free issues on forced station removal during hardware restart on MT76x02
Fixes aee5b8cf2477 ("mt76: implement A-MPDU rx reordering in the driver code")
Signed-off-by Felix Fietkau <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt76/mac80211.c +3 -0
@@ -708,6 +708,9 @@ void __mt76_sta_remove(struct mt76_dev *dev, struct ieee80211_vif *vif,rcu_assign_pointer (dev->wcid[idx],NULL );synchronize_rcu (); +for (i =0 ; i <ARRAY_SIZE (wcid->aggr); i++) +mt76_rx_aggr_stop (dev, wcid, i); +if (dev->drv->sta_remove) dev->drv->sta_remove (dev, vif, sta);
Signature · 1 line
2.17.0