Skip to content

Commit

Permalink
mt76: mt7921: fix crash when startup fails.
Browse files Browse the repository at this point in the history
[ 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 <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
greearb authored and gregkh committed Apr 13, 2022
1 parent 793a370 commit 38fbe80
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/mt7921/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ static void mt7921_stop(struct ieee80211_hw *hw)

cancel_delayed_work_sync(&dev->pm.ps_work);
cancel_work_sync(&dev->pm.wake_work);
cancel_work_sync(&dev->reset_work);
mt76_connac_free_pending_tx_skbs(&dev->pm, NULL);

mt7921_mutex_acquire(dev);
Expand Down

0 comments on commit 38fbe80

Please sign in to comment.