diff mbox series

wifi: mac80211: cancel color change finalize work when link is stopped

Message ID 20240705074326.11172-1-michael-cy.lee@mediatek.com (mailing list archive)
State New
Delegated to: Johannes Berg
Headers show
Series wifi: mac80211: cancel color change finalize work when link is stopped | expand

Commit Message

Michael-CY Lee July 5, 2024, 7:43 a.m. UTC
The color change finalize work might be called after the link is
stopped, which might lead to a kernel crash.

Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
---
 net/mac80211/link.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/net/mac80211/link.c b/net/mac80211/link.c
index 2e6e92defbca..1a211b8d4057 100644
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -71,6 +71,8 @@  void ieee80211_link_stop(struct ieee80211_link_data *link)
 		ieee80211_mgd_stop_link(link);
 
 	cancel_delayed_work_sync(&link->color_collision_detect_work);
+	wiphy_work_cancel(link->sdata->local->hw.wiphy,
+			  &link->color_change_finalize_work);
 	wiphy_work_cancel(link->sdata->local->hw.wiphy,
 			  &link->csa.finalize_work);
 	ieee80211_link_release_channel(link);