From 81eea91e355e1b11b4b4328e76374cfd242226cb Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 8 Jun 2023 22:40:00 +0800
Subject: [PATCH 53/54] hostapd: mtk: change order of link_sta assoc

It seems that link_sta assoc has been moved before main sta assoc, which
is an unexpected behavior for driver. Change the order back.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
 src/ap/ieee802_11.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 7b7e0c803..d59fb4843 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -5511,13 +5511,13 @@ static void handle_assoc(struct hostapd_data *hapd,
 	 *    issues with processing other non-Data Class 3 frames during this
 	 *    window.
 	 */
-	if (resp == WLAN_STATUS_SUCCESS)
-		hostapd_process_assoc_ml_info(hapd, sta, pos, left, reassoc);
-
 	if (resp == WLAN_STATUS_SUCCESS && sta &&
 	    add_associated_sta(hapd, sta, reassoc))
 		resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
 
+	if (resp == WLAN_STATUS_SUCCESS)
+		hostapd_process_assoc_ml_info(hapd, sta, pos, left, reassoc);
+
 #ifdef CONFIG_FILS
 	if (sta && delay_assoc && resp == WLAN_STATUS_SUCCESS &&
 	    eloop_is_timeout_registered(fils_hlp_timeout, hapd, sta) &&
-- 
2.39.2

