aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/wireless/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index b110a8a242db..2781a411cecc 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -177,6 +177,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
177 return -EOPNOTSUPP; 177 return -EOPNOTSUPP;
178 178
179 list_for_each_entry(wdev, &rdev->wdev_list, list) { 179 list_for_each_entry(wdev, &rdev->wdev_list, list) {
180 if (!wdev->netdev)
181 continue;
180 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; 182 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
181 err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); 183 err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
182 if (err) 184 if (err)
@@ -190,6 +192,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
190 192
191 list_for_each_entry_continue_reverse(wdev, &rdev->wdev_list, 193 list_for_each_entry_continue_reverse(wdev, &rdev->wdev_list,
192 list) { 194 list) {
195 if (!wdev->netdev)
196 continue;
193 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; 197 wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
194 err = dev_change_net_namespace(wdev->netdev, net, 198 err = dev_change_net_namespace(wdev->netdev, net,
195 "wlan%d"); 199 "wlan%d");
@@ -227,7 +231,8 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
227 mutex_lock(&rdev->devlist_mtx); 231 mutex_lock(&rdev->devlist_mtx);
228 232
229 list_for_each_entry(wdev, &rdev->wdev_list, list) 233 list_for_each_entry(wdev, &rdev->wdev_list, list)
230 dev_close(wdev->netdev); 234 if (wdev->netdev)
235 dev_close(wdev->netdev);
231 236
232 mutex_unlock(&rdev->devlist_mtx); 237 mutex_unlock(&rdev->devlist_mtx);
233 rtnl_unlock(); 238 rtnl_unlock();