]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: ser: avoid multiple deinit on same CAM
authorZong-Zhe Yang <kevin_yang@realtek.com>
Thu, 9 May 2024 09:06:43 +0000 (17:06 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 14 May 2024 01:27:13 +0000 (09:27 +0800)
We did deinit CAM in STA iteration in VIF loop. But, the STA iteration
missed to restrict the target VIF. So, if there are multiple VIFs, we
would deinit a CAM multiple times. Now, fix it.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240509090646.35304-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/ser.c

index 99896d85d2f81e4a5c37192a838736e0422306fa..5fc2faa9ba5a7ec58ad7ed1f8fb74570775b3680 100644 (file)
@@ -308,9 +308,13 @@ static void ser_reset_vif(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)
 
 static void ser_sta_deinit_cam_iter(void *data, struct ieee80211_sta *sta)
 {
-       struct rtw89_vif *rtwvif = (struct rtw89_vif *)data;
-       struct rtw89_dev *rtwdev = rtwvif->rtwdev;
+       struct rtw89_vif *target_rtwvif = (struct rtw89_vif *)data;
        struct rtw89_sta *rtwsta = (struct rtw89_sta *)sta->drv_priv;
+       struct rtw89_vif *rtwvif = rtwsta->rtwvif;
+       struct rtw89_dev *rtwdev = rtwvif->rtwdev;
+
+       if (rtwvif != target_rtwvif)
+               return;
 
        if (rtwvif->net_type == RTW89_NET_TYPE_AP_MODE || sta->tdls)
                rtw89_cam_deinit_addr_cam(rtwdev, &rtwsta->addr_cam);