summaryrefslogtreecommitdiff
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorSven Neumann <s.neumann@raumfeld.com>2011-08-31 01:38:53 +0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-14 21:26:39 +0400
commiteac03e381957a05f3842ceb8de987a1025966ecf (patch)
tree5dfbfa366c63e481eb92b7f61dbabdd4f82b6ad3 /net/wireless/core.c
parent56e6786e59cba2c714091ed53deffa6001a32841 (diff)
downloadlinux-eac03e381957a05f3842ceb8de987a1025966ecf.tar.xz
cfg80211: hold reg_mutex when updating regulatory
The function wiphy_update_regulatory() uses the static variable last_request and thus needs to be called with reg_mutex held. This is the case for all users in reg.c, but the function was exported for use by wiphy_register(), from where it is called without the lock being held. Fix this by making wiphy_update_regulatory() private and introducing regulatory_update() as a wrapper that acquires and holds the lock. Signed-off-by: Sven Neumann <s.neumann@raumfeld.com> Cc: John W. Linville <linville@tuxdriver.com> Cc: Luis R. Rodriguez <mcgrof@gmail.com> Cc: Daniel Mack <daniel@zonque.org> Cc: linux-wireless@vger.kernel.org Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 645437cfc464..44cbebac25e0 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -582,7 +582,7 @@ int wiphy_register(struct wiphy *wiphy)
}
/* set up regulatory info */
- wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
+ regulatory_update(wiphy, NL80211_REGDOM_SET_BY_CORE);
list_add_rcu(&rdev->list, &cfg80211_rdev_list);
cfg80211_rdev_list_generation++;