[PATCH 1/4] wifi: nxpwifi: cancel channel switch work on teardown
From: Zhao Li
Date: Wed Oct 28 2026 - 10:21:21 EST
Stopping an AP while channel-switch work is pending leaves the delayed
work armed. After driver removal, the callback runs on freed driver
state. If the AP is restarted first, the callback switches it to the old
target channel. Reusing the interface slot can also reinitialize the
work while it is still pending.
Cancel the work when the AP stops. Interface deletion, type changes and
driver removal all stop a running AP first.
LLM assistance was used to find the bug and review.
Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Zhao Li <enderaoelyther@xxxxxxxxx>
---
Validation: A W=1 module build with MODPOST passed. Not
reproduced; IW61x hardware was unavailable.
Sparse C=2 passed. Targeted Smatch introduced no new diagnostics.
drivers/net/wireless/nxp/nxpwifi/cfg80211.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
index 473e81304ca8..384ba69dd058 100644
--- a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
+++ b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
@@ -1638,6 +1638,7 @@ static int nxpwifi_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
struct nxpwifi_private *priv = nxpwifi_netdev_get_priv(dev);
int ret;
+ wiphy_delayed_work_cancel(wiphy, &priv->dfs_chan_sw_work);
nxpwifi_abort_cac(priv);
if (nxpwifi_del_mgmt_ies(priv))
--
2.56.0