diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-06-15 21:13:41 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-06-23 11:42:37 +0300 |
commit | 4ac668a3b8c9d3477a3fe162c1cfeb867dd65de8 (patch) | |
tree | 8e079a93a8174853b86c902662fb29068ccde5a8 /drivers/net/wireless | |
parent | 6247c3b0779c16894bf2f25cbaf613fa3258d1ce (diff) | |
download | linux-4ac668a3b8c9d3477a3fe162c1cfeb867dd65de8.tar.xz |
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")
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
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c index cbbe986655fe..5fda6e7b120c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c @@ -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]); } |