if (!sta->added_unassoc && auth_transaction == 1) {
ap_sta_free_sta_profile(&sta->mld_info);
os_memset(&sta->mld_info, 0, sizeof(sta->mld_info));
+ if ((!(sta->flags & WLAN_STA_MFP) ||
+ !ap_sta_is_authorized(sta)) && sta->wpa_sm) {
+ wpa_auth_sta_deinit(sta->wpa_sm);
+ sta->wpa_sm = NULL;
+ clear_wpa_sm_for_each_partner_link(hapd, sta);
+ }
if (mld_sta) {
u8 link_id = hapd->mld_link_id;
#ifdef CONFIG_IEEE80211BE
-static void clear_wpa_sm_for_each_partner_link(struct hostapd_data *hapd,
- struct sta_info *psta)
+void clear_wpa_sm_for_each_partner_link(struct hostapd_data *hapd,
+ struct sta_info *psta)
{
struct sta_info *lsta;
struct hostapd_data *lhapd;
void ap_sta_free_sta_profile(struct mld_info *info);
void hostapd_free_link_stas(struct hostapd_data *hapd);
+void clear_wpa_sm_for_each_partner_link(struct hostapd_data *hapd,
+ struct sta_info *psta);
#endif /* STA_INFO_H */
os_free(sm->rsnxe);
os_free(sm->rsn_selection);
#ifdef CONFIG_IEEE80211BE
- for_each_sm_auth(sm, link_id)
+ for_each_sm_auth(sm, link_id) {
+ struct wpa_authenticator *wpa_auth;
+
+ wpa_auth = sm->mld_links[link_id].wpa_auth;
sm->mld_links[link_id].wpa_auth = NULL;
+ sm->mld_links[link_id].valid = false;
+ wpa_group_put(wpa_auth, wpa_auth->group);
+ }
#endif /* CONFIG_IEEE80211BE */
wpa_group_put(sm->wpa_auth, sm->group);
#ifdef CONFIG_DPP2