提交 ba22fb5b 编写于 作者: J Johannes Berg

nl80211: don't assume wdev->netdev exists

There are a few places that iterate the wdev
list and assume wdev->netdev exists, check
there. The rfkill one has to be extended for
each non-netdev type later.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 72fb2abc
...@@ -177,6 +177,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, ...@@ -177,6 +177,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
list_for_each_entry(wdev, &rdev->wdev_list, list) { list_for_each_entry(wdev, &rdev->wdev_list, list) {
if (!wdev->netdev)
continue;
wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
if (err) if (err)
...@@ -190,6 +192,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev, ...@@ -190,6 +192,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_device *rdev,
list_for_each_entry_continue_reverse(wdev, &rdev->wdev_list, list_for_each_entry_continue_reverse(wdev, &rdev->wdev_list,
list) { list) {
if (!wdev->netdev)
continue;
wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL; wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
err = dev_change_net_namespace(wdev->netdev, net, err = dev_change_net_namespace(wdev->netdev, net,
"wlan%d"); "wlan%d");
...@@ -227,7 +231,8 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked) ...@@ -227,7 +231,8 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
mutex_lock(&rdev->devlist_mtx); mutex_lock(&rdev->devlist_mtx);
list_for_each_entry(wdev, &rdev->wdev_list, list) list_for_each_entry(wdev, &rdev->wdev_list, list)
dev_close(wdev->netdev); if (wdev->netdev)
dev_close(wdev->netdev);
mutex_unlock(&rdev->devlist_mtx); mutex_unlock(&rdev->devlist_mtx);
rtnl_unlock(); rtnl_unlock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册