Pārlūkot izejas kodu

wireless: core: Reorder wiphy_register() notifications relevantly

Currently it can send regulatory domain change notification before any
NEW_WIPHY notification. Moreover, if rfill_register() fails, calling
wiphy_unregister() will send a DEL_WIPHY though no NEW_WIPHY had been
sent previously.

Thus reordering so it properly notifies NEW_WIPHY before any other.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Tomasz Bursztyka 11 gadi atpakaļ
vecāks
revīzija
a796dac9a6
1 mainītis faili ar 3 papildinājumiem un 4 dzēšanām
  1. 3 4
      net/wireless/core.c

+ 3 - 4
net/wireless/core.c

@@ -635,6 +635,9 @@ int wiphy_register(struct wiphy *wiphy)
 	if (IS_ERR(rdev->wiphy.debugfsdir))
 	if (IS_ERR(rdev->wiphy.debugfsdir))
 		rdev->wiphy.debugfsdir = NULL;
 		rdev->wiphy.debugfsdir = NULL;
 
 
+	cfg80211_debugfs_rdev_add(rdev);
+	nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
+
 	if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
 	if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
 		struct regulatory_request request;
 		struct regulatory_request request;
 
 
@@ -646,8 +649,6 @@ int wiphy_register(struct wiphy *wiphy)
 		nl80211_send_reg_change_event(&request);
 		nl80211_send_reg_change_event(&request);
 	}
 	}
 
 
-	cfg80211_debugfs_rdev_add(rdev);
-
 	rdev->wiphy.registered = true;
 	rdev->wiphy.registered = true;
 	rtnl_unlock();
 	rtnl_unlock();
 
 
@@ -659,8 +660,6 @@ int wiphy_register(struct wiphy *wiphy)
 		return res;
 		return res;
 	}
 	}
 
 
-	nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);
-
 	return 0;
 	return 0;
 }
 }
 EXPORT_SYMBOL(wiphy_register);
 EXPORT_SYMBOL(wiphy_register);