Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210256
b: refs/heads/master
c: c3d34d5
h: refs/heads/master
v: v3
  • Loading branch information
John W. Linville committed Aug 31, 2010
1 parent 62b0995 commit 22fe37c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42da2f948d949efd0111309f5827bf0298bcc9a4
refs/heads/master: c3d34d5d9654ec9c2510f9341bfb1030b8f029d1
21 changes: 12 additions & 9 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,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);
Expand Down Expand Up @@ -509,13 +507,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);
Expand Down

0 comments on commit 22fe37c

Please sign in to comment.