linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RTF] iwmc3200wifi: fix device registration ordering for cfg80211
@ 2011-03-18  3:10 Luis R. Rodriguez
  2011-03-18  3:11 ` Luis R. Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Luis R. Rodriguez @ 2011-03-18  3:10 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, vmehta, naveen.singh, Luis R. Rodriguez,
	stable, Naveen Singh, Wey-Yi Guy, Intel Linux Wireless

Without this you can get a race against udev and userspace daemons
which will try to poke the device even before netdev ops and friends
are available. Device initialization will fail without this.

Cc: stable@kernel.org
Cc: Naveen Singh <nsingh@atheros.com>
Cc: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---

I'm pretty sure this is correct, I noticed ath6kl followed the same path as
iwmc3200wifi and I spotted a bug on ath6kl with this path.. so I'm pretty damn
sure this bug is also present on iwmc3200wifi. Please test.

 drivers/net/wireless/iwmc3200wifi/cfg80211.c |    9 ---------
 drivers/net/wireless/iwmc3200wifi/netdev.c   |    6 ++++++
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
index ed57e44..2f48f72 100644
--- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c
+++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
@@ -837,17 +837,8 @@ struct wireless_dev *iwm_wdev_alloc(int sizeof_bus, struct device *dev)
 	wdev->wiphy->cipher_suites = cipher_suites;
 	wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
 
-	ret = wiphy_register(wdev->wiphy);
-	if (ret < 0) {
-		dev_err(dev, "Couldn't register wiphy device\n");
-		goto out_err_register;
-	}
-
 	return wdev;
 
- out_err_register:
-	wiphy_free(wdev->wiphy);
-
  out_err_new:
 	kfree(wdev);
 
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index 5091d77..731058e 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -145,6 +145,12 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
 
 	iwm_init_default_profile(iwm, iwm->umac_profile);
 
+	ret = wiphy_register(wdev->wiphy);
+	if (ret < 0) {
+		dev_err(dev, "Couldn't register wiphy device\n");
+		goto out_profile;
+	}
+
 	return iwm;
 
  out_profile:
-- 
1.7.4.15.g7811d


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-18 18:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18  3:10 [RTF] iwmc3200wifi: fix device registration ordering for cfg80211 Luis R. Rodriguez
2011-03-18  3:11 ` Luis R. Rodriguez
2011-03-18 13:50   ` John W. Linville
2011-03-18 16:05     ` Luis R. Rodriguez
2011-03-18 17:41       ` Luis R. Rodriguez
2011-03-18 18:03         ` Johannes Berg
2011-03-18 18:05           ` Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).