aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-02-21 00:04:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:56 -0500
commit761cf7ecffc4bc079679e65c3b1ab107c1c1fb56 (patch)
treebd9ff2715f6f191c31368c9efc534fdc68187705 /net/wireless/core.c
parentbcf4f99b7b1e0971b79e8df40331e77fc1744049 (diff)
cfg80211: add assert_cfg80211_lock() to ensure proper protection
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 39d40d1e06d..e347093ccc7 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -7,7 +7,6 @@
7#include <linux/if.h> 7#include <linux/if.h>
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/err.h> 9#include <linux/err.h>
10#include <linux/mutex.h>
11#include <linux/list.h> 10#include <linux/list.h>
12#include <linux/nl80211.h> 11#include <linux/nl80211.h>
13#include <linux/debugfs.h> 12#include <linux/debugfs.h>
@@ -50,6 +49,8 @@ cfg80211_drv_by_wiphy_idx(int wiphy_idx)
50 if (!wiphy_idx_valid(wiphy_idx)) 49 if (!wiphy_idx_valid(wiphy_idx))
51 return NULL; 50 return NULL;
52 51
52 assert_cfg80211_lock();
53
53 list_for_each_entry(drv, &cfg80211_drv_list, list) { 54 list_for_each_entry(drv, &cfg80211_drv_list, list) {
54 if (drv->wiphy_idx == wiphy_idx) { 55 if (drv->wiphy_idx == wiphy_idx) {
55 result = drv; 56 result = drv;
@@ -69,6 +70,8 @@ __cfg80211_drv_from_info(struct genl_info *info)
69 struct net_device *dev; 70 struct net_device *dev;
70 int err = -EINVAL; 71 int err = -EINVAL;
71 72
73 assert_cfg80211_lock();
74
72 if (info->attrs[NL80211_ATTR_WIPHY]) { 75 if (info->attrs[NL80211_ATTR_WIPHY]) {
73 bywiphyidx = cfg80211_drv_by_wiphy_idx( 76 bywiphyidx = cfg80211_drv_by_wiphy_idx(
74 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY])); 77 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY]));