Skip to content

Commit 38fbe80

Browse files
greearbgregkh
authored andcommitted
mt76: mt7921: fix crash when startup fails.
[ Upstream commit 827e779 ] If the nic fails to start, it is possible that the reset_work has already been scheduled. Ensure the work item is canceled so we do not have use-after-free crash in case cleanup is called before the work item is executed. This fixes crash on my x86_64 apu2 when mt7921k radio fails to work. Radio still fails, but OS does not crash. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 793a370 commit 38fbe80

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/wireless/mediatek/mt76/mt7921

1 file changed

+1
-0
lines changed

drivers/net/wireless/mediatek/mt76/mt7921/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ static void mt7921_stop(struct ieee80211_hw *hw)
224224

225225
cancel_delayed_work_sync(&dev->pm.ps_work);
226226
cancel_work_sync(&dev->pm.wake_work);
227+
cancel_work_sync(&dev->reset_work);
227228
mt76_connac_free_pending_tx_skbs(&dev->pm, NULL);
228229

229230
mt7921_mutex_acquire(dev);

0 commit comments

Comments
 (0)