When tearing down an MLD AP_VLAN interface, a station may still be present when the AP_VLAN links are cleared. Clearing the links eventually calls ieee80211_vif_update_links(), which expects all associated stations to be removed before the interface link is changed. If the station is still present, it gets flushed from sta_info_flush() during the link update, causing the following warning: WARNING: net/mac80211/link.c:362 at ieee80211_vif_update_links+0x161/0x917 Call Trace: ieee80211_vif_update_links ieee80211_vif_set_links ieee80211_do_stop ieee80211_stop cfg80211_shutdown_all_interfaces ieee80211_remove_interfaces Move ieee80211_apvlan_link_clear() after the sta_info_flush() in ieee80211_do_stop() to ensure that all stations are removed before clearing the AP_VLAN links. Fixes: 90233b0ad215 ("wifi: mac80211: Create separate links for VLAN interfaces") Signed-off-by: Aaradhana Sahu --- net/mac80211/iface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index b6ed6541bc42..52cb4f47e938 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -511,9 +511,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do case NL80211_IFTYPE_MONITOR: list_del_rcu(&sdata->u.mntr.list); break; - case NL80211_IFTYPE_AP_VLAN: - ieee80211_apvlan_link_clear(sdata); - break; default: break; } @@ -537,6 +534,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do sdata->vif.type != NL80211_IFTYPE_NAN && sdata->vif.type != NL80211_IFTYPE_NAN_DATA && flushed > 0); + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) + ieee80211_apvlan_link_clear(sdata); + /* don't count this interface for allmulti while it is down */ if (sdata->flags & IEEE80211_SDATA_ALLMULTI) atomic_dec(&local->iff_allmultis); --- base-commit: 711d8d84f73b10c5706501b720f3e3702c0afca5 change-id: 20261202-remove-station-before-clearing-ap_vlan-feb18c37364c