aboutsummaryrefslogtreecommitdiff
path: root/net/wireless/core.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-04 13:28:18 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-07-04 13:30:23 +0200
commitc5a7e582490c423f0685e42ee5cfb7c6de81adb0 (patch)
tree6eda6d23264d9f434e6e92445168e55c16ea3300 /net/wireless/core.h
parenta1845fc7c552977e23fe552ad3f5c6c279e3d550 (diff)
cfg80211: fix locking regression in monitor channel tracking
Michal's monitor channel tracking introduce a locking problem as it locked the rdev lock inside the netdev notifier which isn't allowed as we might already hold it if we get there by removing an interface that is up. Fix this by relying only on the RTNL to protect the interface counters, the RTNL is always held in these code paths anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/core.h')
-rw-r--r--net/wireless/core.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 81fef3ddb5a..377dc394f48 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -13,6 +13,7 @@
#include <linux/debugfs.h>
#include <linux/rfkill.h>
#include <linux/workqueue.h>
+#include <linux/rtnetlink.h>
#include <net/genetlink.h>
#include <net/cfg80211.h>
#include "reg.h"
@@ -56,6 +57,7 @@ struct cfg80211_registered_device {
u32 ap_beacons_nlpid;
+ /* protected by RTNL only */
int num_running_ifaces;
int num_running_monitor_ifaces;
@@ -205,7 +207,7 @@ static inline void wdev_unlock(struct wireless_dev *wdev)
static inline bool cfg80211_has_monitors_only(struct cfg80211_registered_device *rdev)
{
- ASSERT_RDEV_LOCK(rdev);
+ ASSERT_RTNL();
return rdev->num_running_ifaces == rdev->num_running_monitor_ifaces &&
rdev->num_running_ifaces > 0;