mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] wifi: cw1200: unwind failed interface additions
@ 2026-10-19  1:31 Jiale Yao
  0 siblings, 0 replies; only message in thread
From: Jiale Yao @ 2026-10-19  1:31 UTC (permalink / raw)
  To: Solomon Peachy, John W. Linville, linux-wireless, linux-kernel; +Cc: Jiale Yao

cw1200 publishes the vif and changes its mode before cw1200_setup_mac(),
but leaves that state in place if setup fails. mac80211 will not call
remove_interface for the failed addition, so subsequent interface
requests are rejected as busy.

Restore the empty monitor state when MAC setup fails.

Fixes: a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/net/wireless/st/cw1200/sta.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/st/cw1200/sta.c b/drivers/net/wireless/st/cw1200/sta.c
index 5d8eaa700779..92a729f1e9ef 100644
--- a/drivers/net/wireless/st/cw1200/sta.c
+++ b/drivers/net/wireless/st/cw1200/sta.c
@@ -235,6 +235,11 @@ int cw1200_add_interface(struct ieee80211_hw *dev,
 	priv->vif = vif;
 	memcpy(priv->mac_addr, vif->addr, ETH_ALEN);
 	ret = cw1200_setup_mac(priv);
+	if (ret) {
+		priv->vif = NULL;
+		priv->mode = NL80211_IFTYPE_MONITOR;
+		eth_zero_addr(priv->mac_addr);
+	}
 	/* Enable auto-calibration */
 	/* Exception in subsequent channel switch; disabled.
 	 *  wsm_write_mib(priv, WSM_MIB_ID_SET_AUTO_CALIBRATION_MODE,
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-19  1:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19  1:31 [PATCH] wifi: cw1200: unwind failed interface additions Jiale Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®