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: d3377b78cec6 ("mt76: add HE phy modes and hardware queue")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Jun 14, 2020
1 parent 4058595 commit 49c7131
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mt76x02_mmio.c
Expand Up @@ -455,8 +455,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 @@ -514,7 +515,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 49c7131

Please sign in to comment.