public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless-next] wifi: mac80211: fix STA link removal during link removal
@ 2026-03-18 17:06 Johannes Berg
  2026-03-18 17:24 ` Lorenzo Bianconi
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2026-03-18 17:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Lorenzo Bianconi, Johannes Berg, Jouni Malinen

From: Johannes Berg <johannes.berg@intel.com>

ieee80211_sta_free_link() only frees the link and doesn't
unhash it, so it can't be used here. Instead this needs
to use ieee80211_sta_remove_link(), which unhashes it. An
argument against it was that it also calls the driver and
that already happened, but calls to the driver removing a
link that's already removed are suppressed, so that's not
actually an issue. Use it to fix the hashtable.

Reported-and-tested-by: Jouni Malinen <j@w1.fi>
Fixes: 84674b03d8bf ("wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f279bdb03aca..0cd8d07bf668 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -7119,7 +7119,7 @@ static void ieee80211_ml_reconf_work(struct wiphy *wiphy,
 
 		for_each_set_bit(link_id, &removed_links,
 				 IEEE80211_MLD_MAX_NUM_LINKS)
-			ieee80211_sta_free_link(sta, link_id);
+			ieee80211_sta_remove_link(sta, link_id);
 	}
 
 	new_dormant_links = sdata->vif.dormant_links & ~sdata->u.mgd.removed_links;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH wireless-next] wifi: mac80211: fix STA link removal during link removal
  2026-03-18 17:06 [PATCH wireless-next] wifi: mac80211: fix STA link removal during link removal Johannes Berg
@ 2026-03-18 17:24 ` Lorenzo Bianconi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Bianconi @ 2026-03-18 17:24 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Johannes Berg, Jouni Malinen

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

> From: Johannes Berg <johannes.berg@intel.com>
> 
> ieee80211_sta_free_link() only frees the link and doesn't
> unhash it, so it can't be used here. Instead this needs
> to use ieee80211_sta_remove_link(), which unhashes it. An
> argument against it was that it also calls the driver and
> that already happened, but calls to the driver removing a
> link that's already removed are suppressed, so that's not
> actually an issue. Use it to fix the hashtable.
> 
> Reported-and-tested-by: Jouni Malinen <j@w1.fi>
> Fixes: 84674b03d8bf ("wifi: mac80211: Remove deleted sta links in ieee80211_ml_reconf_work()")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

Thanks for fixing it.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  net/mac80211/mlme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index f279bdb03aca..0cd8d07bf668 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -7119,7 +7119,7 @@ static void ieee80211_ml_reconf_work(struct wiphy *wiphy,
>  
>  		for_each_set_bit(link_id, &removed_links,
>  				 IEEE80211_MLD_MAX_NUM_LINKS)
> -			ieee80211_sta_free_link(sta, link_id);
> +			ieee80211_sta_remove_link(sta, link_id);
>  	}
>  
>  	new_dormant_links = sdata->vif.dormant_links & ~sdata->u.mgd.removed_links;
> -- 
> 2.53.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-18 17:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 17:06 [PATCH wireless-next] wifi: mac80211: fix STA link removal during link removal Johannes Berg
2026-03-18 17:24 ` Lorenzo Bianconi

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