File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
drivers/net/wireless/realtek/rtw89 Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,9 @@ static int rtw89_ops_add_interface(struct ieee80211_hw *hw,
126
126
rtwvif -> rtwdev = rtwdev ;
127
127
rtwvif -> roc .state = RTW89_ROC_IDLE ;
128
128
rtwvif -> offchan = false;
129
- list_add_tail (& rtwvif -> list , & rtwdev -> rtwvifs_list );
129
+ if (!rtw89_rtwvif_in_list (rtwdev , rtwvif ))
130
+ list_add_tail (& rtwvif -> list , & rtwdev -> rtwvifs_list );
131
+
130
132
INIT_WORK (& rtwvif -> update_beacon_work , rtw89_core_update_beacon_work );
131
133
INIT_DELAYED_WORK (& rtwvif -> roc .roc_work , rtw89_roc_work );
132
134
rtw89_leave_ps_mode (rtwdev );
Original file line number Diff line number Diff line change 16
16
#define rtw89_for_each_rtwvif (rtwdev , rtwvif ) \
17
17
list_for_each_entry(rtwvif, &(rtwdev)->rtwvifs_list, list)
18
18
19
+ /* Before adding rtwvif to list, we need to check if it already exist, beacase
20
+ * in some case such as SER L2 happen during WoWLAN flow, calling reconfig
21
+ * twice cause the list to be added twice.
22
+ */
23
+ static inline bool rtw89_rtwvif_in_list (struct rtw89_dev * rtwdev ,
24
+ struct rtw89_vif * new )
25
+ {
26
+ struct rtw89_vif * rtwvif ;
27
+
28
+ lockdep_assert_held (& rtwdev -> mutex );
29
+
30
+ rtw89_for_each_rtwvif (rtwdev , rtwvif )
31
+ if (rtwvif == new )
32
+ return true;
33
+
34
+ return false;
35
+ }
36
+
19
37
/* The result of negative dividend and positive divisor is undefined, but it
20
38
* should be one case of round-down or round-up. So, make it round-down if the
21
39
* result is round-up.
You can’t perform that action at this time.
0 commit comments