diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-10-21 05:33:35 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-10-21 05:59:15 -0400 |
commit | 79845c662eeb95c9a180b9bd0d3ad848ee65b94c (patch) | |
tree | 191a0f1abdc8af9391159bd09c11fa981204aa12 /net/wireless | |
parent | 095d81cee742fc31e1218077ca6ca8f0df07c613 (diff) |
cfg80211: fix scheduled scan pointer access
Since rdev->sched_scan_req is dereferenced outside the
lock protecting it, this might be done at the wrong
time, causing crashes. Move the dereference to where
it should be - inside the RTNL locked section.
Cc: stable@vger.kernel.org [3.8+]
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/scan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index eeb71480f1af..d4397eba5408 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -254,10 +254,10 @@ void __cfg80211_sched_scan_results(struct work_struct *wk) | |||
254 | rdev = container_of(wk, struct cfg80211_registered_device, | 254 | rdev = container_of(wk, struct cfg80211_registered_device, |
255 | sched_scan_results_wk); | 255 | sched_scan_results_wk); |
256 | 256 | ||
257 | request = rdev->sched_scan_req; | ||
258 | |||
259 | rtnl_lock(); | 257 | rtnl_lock(); |
260 | 258 | ||
259 | request = rdev->sched_scan_req; | ||
260 | |||
261 | /* we don't have sched_scan_req anymore if the scan is stopping */ | 261 | /* we don't have sched_scan_req anymore if the scan is stopping */ |
262 | if (request) { | 262 | if (request) { |
263 | if (request->flags & NL80211_SCAN_FLAG_FLUSH) { | 263 | if (request->flags & NL80211_SCAN_FLAG_FLUSH) { |