@@ -1122,9 +1122,6 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local)
1122
1122
struct ieee80211_sub_if_data * sdata ;
1123
1123
int ret ;
1124
1124
1125
- if (!ieee80211_hw_check (& local -> hw , WANT_MONITOR_VIF ))
1126
- return 0 ;
1127
-
1128
1125
ASSERT_RTNL ();
1129
1126
lockdep_assert_wiphy (local -> hw .wiphy );
1130
1127
@@ -1146,11 +1143,13 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local)
1146
1143
1147
1144
ieee80211_set_default_queues (sdata );
1148
1145
1149
- ret = drv_add_interface (local , sdata );
1150
- if (WARN_ON (ret )) {
1151
- /* ok .. stupid driver, it asked for this! */
1152
- kfree (sdata );
1153
- return ret ;
1146
+ if (ieee80211_hw_check (& local -> hw , WANT_MONITOR_VIF )) {
1147
+ ret = drv_add_interface (local , sdata );
1148
+ if (WARN_ON (ret )) {
1149
+ /* ok .. stupid driver, it asked for this! */
1150
+ kfree (sdata );
1151
+ return ret ;
1152
+ }
1154
1153
}
1155
1154
1156
1155
set_bit (SDATA_STATE_RUNNING , & sdata -> state );
@@ -1188,9 +1187,6 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
1188
1187
{
1189
1188
struct ieee80211_sub_if_data * sdata ;
1190
1189
1191
- if (!ieee80211_hw_check (& local -> hw , WANT_MONITOR_VIF ))
1192
- return ;
1193
-
1194
1190
ASSERT_RTNL ();
1195
1191
lockdep_assert_wiphy (local -> hw .wiphy );
1196
1192
@@ -1210,7 +1206,8 @@ void ieee80211_del_virtual_monitor(struct ieee80211_local *local)
1210
1206
1211
1207
ieee80211_link_release_channel (& sdata -> deflink );
1212
1208
1213
- drv_remove_interface (local , sdata );
1209
+ if (ieee80211_hw_check (& local -> hw , WANT_MONITOR_VIF ))
1210
+ drv_remove_interface (local , sdata );
1214
1211
1215
1212
kfree (sdata );
1216
1213
}
0 commit comments