From: Michael-CY Lee Date: Fri, 5 Jul 2024 07:43:26 +0000 (+0800) Subject: wifi: mac80211: cancel color change finalize work when link is stopped X-Git-Tag: v6.11-rc1~163^2~49^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cd445635562a38c1e3534e3e691c25d2737be54;p=thirdparty%2Fkernel%2Fstable.git wifi: mac80211: cancel color change finalize work when link is stopped 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 Link: https://patch.msgid.link/20240705074326.11172-1-michael-cy.lee@mediatek.com Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 2e6e92defbca6..1a211b8d40573 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);