diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2010-11-17 21:46:08 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-22 15:48:50 -0500 |
commit | b0e2880b0518ad11af20c7c93ec5cac93f9f03b0 (patch) | |
tree | fe8b2f27d1515100a74e80d86f99ce608abfa296 /net/wireless/reg.c | |
parent | f333a7a2f49e2a9b46f8d18962bd750b18beeecd (diff) | |
download | linux-b0e2880b0518ad11af20c7c93ec5cac93f9f03b0.tar.bz2 |
cfg80211: move mutex locking to reg_process_pending_hints()
This will be required in the next patch and it makes the
next patch easier to review.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Mark Mentovai <mark@moxienet.com>
Tested-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 3fa247488f87..b522c46c4748 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1412,16 +1412,13 @@ static void reg_process_hint(struct regulatory_request *reg_request) BUG_ON(!reg_request->alpha2); - mutex_lock(&cfg80211_mutex); - mutex_lock(®_mutex); - if (wiphy_idx_valid(reg_request->wiphy_idx)) wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && !wiphy) { kfree(reg_request); - goto out; + return; } r = __regulatory_hint(wiphy, reg_request); @@ -1429,16 +1426,16 @@ static void reg_process_hint(struct regulatory_request *reg_request) if (r == -EALREADY && wiphy && wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) wiphy_update_regulatory(wiphy, initiator); -out: - mutex_unlock(®_mutex); - mutex_unlock(&cfg80211_mutex); } /* Processes regulatory hints, this is all the NL80211_REGDOM_SET_BY_* */ static void reg_process_pending_hints(void) - { +{ struct regulatory_request *reg_request; + mutex_lock(&cfg80211_mutex); + mutex_lock(®_mutex); + spin_lock(®_requests_lock); while (!list_empty(®_requests_list)) { reg_request = list_first_entry(®_requests_list, @@ -1451,6 +1448,9 @@ static void reg_process_pending_hints(void) spin_lock(®_requests_lock); } spin_unlock(®_requests_lock); + + mutex_unlock(®_mutex); + mutex_unlock(&cfg80211_mutex); } /* Processes beacon hints -- this has nothing to do with country IEs */ |