diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-09-24 23:52:34 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-24 23:52:34 +0400 |
commit | 29ad2facd47f8e37eab8b156e2c384fa181c8b4a (patch) | |
tree | 25d4df186cd631810ff15a8e7d37cb6cdd806cdb /net/wireless/core.c | |
parent | 6e5c2b4e8addfaab8ef54dedaf7b607e1585c35b (diff) | |
parent | cd87a2d3a33d75a646f1aa1aa2ee5bf712d6f963 (diff) | |
download | linux-29ad2facd47f8e37eab8b156e2c384fa181c8b4a.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/ath/ath5k/base.c
net/mac80211/main.c
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index ff9615a7ee7a..9c21ebf9780e 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -480,12 +480,10 @@ int wiphy_register(struct wiphy *wiphy) mutex_lock(&cfg80211_mutex); res = device_add(&rdev->wiphy.dev); - if (res) - goto out_unlock; - - res = rfkill_register(rdev->rfkill); - if (res) - goto out_rm_dev; + if (res) { + mutex_unlock(&cfg80211_mutex); + return res; + } /* set up regulatory info */ wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); @@ -514,13 +512,18 @@ int wiphy_register(struct wiphy *wiphy) cfg80211_debugfs_rdev_add(rdev); mutex_unlock(&cfg80211_mutex); + /* + * due to a locking dependency this has to be outside of the + * cfg80211_mutex lock + */ + res = rfkill_register(rdev->rfkill); + if (res) + goto out_rm_dev; + return 0; out_rm_dev: device_del(&rdev->wiphy.dev); - -out_unlock: - mutex_unlock(&cfg80211_mutex); return res; } EXPORT_SYMBOL(wiphy_register); |