mm: introduce VM_BUG_ON_VMA
[firefly-linux-kernel-4.4.55.git] / net / wireless / core.c
index afee5e0455ea460b9b3d2e39c27e7eb0d881fa9f..f52a4cd7017c855c1c64f9ee2bbe2b0b44b625cc 100644 (file)
@@ -2,6 +2,7 @@
  * This is the linux wireless configuration interface.
  *
  * Copyright 2006-2010         Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -492,12 +493,6 @@ int wiphy_register(struct wiphy *wiphy)
        int i;
        u16 ifmodes = wiphy->interface_modes;
 
-       /*
-        * There are major locking problems in nl80211/mac80211 for CSA,
-        * disable for all drivers until this has been reworked.
-        */
-       wiphy->flags &= ~WIPHY_FLAG_HAS_CHANNEL_SWITCH;
-
 #ifdef CONFIG_PM
        if (WARN_ON(wiphy->wowlan &&
                    (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
@@ -635,6 +630,9 @@ int wiphy_register(struct wiphy *wiphy)
        if (IS_ERR(rdev->wiphy.debugfsdir))
                rdev->wiphy.debugfsdir = NULL;
 
+       cfg80211_debugfs_rdev_add(rdev);
+       nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
+
        if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
                struct regulatory_request request;
 
@@ -646,8 +644,6 @@ int wiphy_register(struct wiphy *wiphy)
                nl80211_send_reg_change_event(&request);
        }
 
-       cfg80211_debugfs_rdev_add(rdev);
-
        rdev->wiphy.registered = true;
        rtnl_unlock();
 
@@ -659,8 +655,6 @@ int wiphy_register(struct wiphy *wiphy)
                return res;
        }
 
-       nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
-
        return 0;
 }
 EXPORT_SYMBOL(wiphy_register);
@@ -1012,7 +1006,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
                        rdev->devlist_generation++;
                        cfg80211_mlme_purge_registrations(wdev);
 #ifdef CONFIG_CFG80211_WEXT
-                       kfree(wdev->wext.keys);
+                       kzfree(wdev->wext.keys);
 #endif
                }
                /*