Skip to content

Commit

Permalink
mac80211: release sched_scan_sdata when stopping sched scan
Browse files Browse the repository at this point in the history
Assuming sched_scan_stop operation is synchronous the driver may not
necessary call ieee80211_sched_scan_stopped_work. Since this work is
the only place where sched_scan_sdata is released we can possibly run
into situation when it is never released. Fix this by releasing it
just after calling drv_sched_scan_stop.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Alexander Bondar authored and Johannes Berg committed Mar 19, 2014
1 parent 112c44b commit 71228a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,11 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata)
/* We don't want to restart sched scan anymore. */
local->sched_scan_req = NULL;

if (rcu_access_pointer(local->sched_scan_sdata))
if (rcu_access_pointer(local->sched_scan_sdata)) {
ret = drv_sched_scan_stop(local, sdata);

if (!ret)
rcu_assign_pointer(local->sched_scan_sdata, NULL);
}
out:
mutex_unlock(&local->mtx);

Expand Down

0 comments on commit 71228a1

Please sign in to comment.