Skip to content

Commit

Permalink
mt76: mt76x02: do not access uninitialized NAPI structs
Browse files Browse the repository at this point in the history
Fixes a crash on MMIO devices when running into the watchdog reset

Fixes: d3377b7 ("mt76: add HE phy modes and hardware queue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200615181341.81871-1-nbd@nbd.name
  • Loading branch information
Felix Fietkau authored and Kalle Valo committed Jun 23, 2020
1 parent 6247c3b commit 4ac668a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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]);
}
Expand Down

0 comments on commit 4ac668a

Please sign in to comment.