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 14
14
#define rtw89_for_each_rtwvif (rtwdev , rtwvif ) \
15
15
list_for_each_entry(rtwvif, &(rtwdev)->rtwvifs_list, list)
16
16
17
+ /* Before adding rtwvif to list, we need to check if it already exist, beacase
18
+ * in some case such as SER L2 happen during WoWLAN flow, calling reconfig
19
+ * twice cause the list to be added twice.
20
+ */
21
+ static inline bool rtw89_rtwvif_in_list (struct rtw89_dev * rtwdev ,
22
+ struct rtw89_vif * new )
23
+ {
24
+ struct rtw89_vif * rtwvif ;
25
+
26
+ lockdep_assert_held (& rtwdev -> mutex );
27
+
28
+ rtw89_for_each_rtwvif (rtwdev , rtwvif )
29
+ if (rtwvif == new )
30
+ return true;
31
+
32
+ return false;
33
+ }
34
+
17
35
/* The result of negative dividend and positive divisor is undefined, but it
18
36
* should be one case of round-down or round-up. So, make it round-down if the
19
37
* result is round-up.
You can’t perform that action at this time.
0 commit comments