Skip to contentSkip to conversation

mt76: mt76x02: do not access uninitialized NAPI structs

PATCH In review Felix Fietkau 2 participants 2 messages Jun 15, 2020 – Jun 23, 2020

Subsystems (2)
lore
Share & tools
lore

Felix Fietkau

author maintainer
#0 lore raw

PATCH 1/1 mt76: mt76x02: do not access uninitialized NAPI structs

Fixes a crash on MMIO devices when running into the watchdog reset

Fixes d3377b78cec6 ("mt76: add HE phy modes and hardware queue")
---
 drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +3 -2
index cbbe986655fe..5fda6e7b120c 100644
@@ -456,8 +456,9 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 	tasklet_disable(&dev->mt76.tx_tasklet);
 	napi_disable(&dev->mt76.tx_napi);
 
-	for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++)
+	mt76_for_each_q_rx(&dev->mt76, i) {
 		napi_disable(&dev->mt76.napi[i]);
+	}
 
 	mutex_lock(&dev->mt76.mutex);
 
@@ -515,7 +516,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
 
 	tasklet_enable(&dev->mt76.pre_tbtt_tasklet);
 
-	for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) {
+	mt76_for_each_q_rx(&dev->mt76, i) {
 		napi_enable(&dev->mt76.napi[i]);
 		napi_schedule(&dev->mt76.napi[i]);
 	}
Signature · 1 line
2.24.0
#1 lore raw
Quoted 4 lines · Felix Fietkau

Fixes a crash on MMIO devices when running into the watchdog reset

Fixes d3377b78cec6 ("mt76: add HE phy modes and hardware queue")

Patch applied to wireless-drivers.git, thanks.

4ac668a3b8c9 mt76: mt76x02: do not access uninitialized NAPI structs

Signature · 3 lines
https://patchwork.kernel.org/patch/11605487/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches