diff options
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 68f0c96c0565..58e69d691601 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -639,17 +639,21 @@ int wiphy_register(struct wiphy *wiphy) | |||
639 | * cfg80211_mutex lock | 639 | * cfg80211_mutex lock |
640 | */ | 640 | */ |
641 | res = rfkill_register(rdev->rfkill); | 641 | res = rfkill_register(rdev->rfkill); |
642 | if (res) | 642 | if (res) { |
643 | goto out_rm_dev; | 643 | device_del(&rdev->wiphy.dev); |
644 | |||
645 | mutex_lock(&cfg80211_mutex); | ||
646 | debugfs_remove_recursive(rdev->wiphy.debugfsdir); | ||
647 | list_del_rcu(&rdev->list); | ||
648 | wiphy_regulatory_deregister(wiphy); | ||
649 | mutex_unlock(&cfg80211_mutex); | ||
650 | return res; | ||
651 | } | ||
644 | 652 | ||
645 | rtnl_lock(); | 653 | rtnl_lock(); |
646 | rdev->wiphy.registered = true; | 654 | rdev->wiphy.registered = true; |
647 | rtnl_unlock(); | 655 | rtnl_unlock(); |
648 | return 0; | 656 | return 0; |
649 | |||
650 | out_rm_dev: | ||
651 | device_del(&rdev->wiphy.dev); | ||
652 | return res; | ||
653 | } | 657 | } |
654 | EXPORT_SYMBOL(wiphy_register); | 658 | EXPORT_SYMBOL(wiphy_register); |
655 | 659 | ||
@@ -867,7 +871,6 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev, | |||
867 | #endif | 871 | #endif |
868 | __cfg80211_disconnect(rdev, dev, | 872 | __cfg80211_disconnect(rdev, dev, |
869 | WLAN_REASON_DEAUTH_LEAVING, true); | 873 | WLAN_REASON_DEAUTH_LEAVING, true); |
870 | cfg80211_mlme_down(rdev, dev); | ||
871 | wdev_unlock(wdev); | 874 | wdev_unlock(wdev); |
872 | break; | 875 | break; |
873 | case NL80211_IFTYPE_MESH_POINT: | 876 | case NL80211_IFTYPE_MESH_POINT: |