]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mt76: mt7921: fix crash when startup fails.
authorBen Greear <greearb@candelatech.com>
Sat, 8 Jan 2022 19:08:14 +0000 (11:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:02:59 +0000 (20:02 +0200)
commitc1a5e6002ec441a3b9fb4d048b4b49ae93409a46
treeaa3cf99cbefe3caf5240159773138f8774ba1d33
parentf446a9e73940fcd997fcb92d16554849fdfb65de
mt76: mt7921: fix crash when startup fails.

[ Upstream commit 827e7799c61b978fbc2cc9dac66cb62401b2b3f0 ]

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>
drivers/net/wireless/mediatek/mt76/mt7921/main.c