summaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-01-22 11:14:19 +0200
committerJohannes Berg <johannes.berg@intel.com>2014-02-06 09:55:19 +0100
commitf9d15d162b3acf28f85b3ac05c4883e5ed588d28 (patch)
tree1c78c9fd0d81302190738d2778db000f9506e4fa /net/wireless/sme.c
parenta617302c531eaf497ccd02a61d380efc119ba999 (diff)
downloadlinux-stable-f9d15d162b3acf28f85b3ac05c4883e5ed588d28.tar.gz
linux-stable-f9d15d162b3acf28f85b3ac05c4883e5ed588d28.tar.bz2
linux-stable-f9d15d162b3acf28f85b3ac05c4883e5ed588d28.zip
cfg80211: send scan results from work queue
Due to the previous commit, when a scan finishes, it is in theory possible to hit the following sequence: 1. interface starts being removed 2. scan is cancelled by driver and cfg80211 is notified 3. scan done work is scheduled 4. interface is removed completely, rdev->scan_req is freed, event sent to userspace but scan done work remains pending 5. new scan is requested on another virtual interface 6. scan done work runs, freeing the still-running scan To fix this situation, hang on to the scan done message and block new scans while that is the case, and only send the message from the work function, regardless of whether the scan_req is already freed from interface removal. This makes step 5 above impossible and changes step 6 to be 5. scan done work runs, sending the scan done message As this can't work for wext, so we send the message immediately, but this shouldn't be an issue since we still return -EBUSY. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index a63509118508..f04d4c32e96e 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -67,7 +67,7 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
ASSERT_RDEV_LOCK(rdev);
ASSERT_WDEV_LOCK(wdev);
- if (rdev->scan_req)
+ if (rdev->scan_req || rdev->scan_msg)
return -EBUSY;
if (wdev->conn->params.channel)