linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Release sched_scan_sdata when stopping sched scan
@ 2014-03-16  8:49 Emmanuel Grumbach
  2014-03-19 14:01 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Emmanuel Grumbach @ 2014-03-16  8:49 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Alexander Bondar

From: Alexander Bondar <alexander.bondar@intel.com>


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>
---
 net/mac80211/scan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 836f500..3ce7f2c 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -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);
 
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Release sched_scan_sdata when stopping sched scan
  2014-03-16  8:49 [PATCH] mac80211: Release sched_scan_sdata when stopping sched scan Emmanuel Grumbach
@ 2014-03-19 14:01 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2014-03-19 14:01 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless, Alexander Bondar

On Sun, 2014-03-16 at 10:49 +0200, Emmanuel Grumbach wrote:
> From: Alexander Bondar <alexander.bondar@intel.com>
> 
> 
> 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.

Applied.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-19 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-16  8:49 [PATCH] mac80211: Release sched_scan_sdata when stopping sched scan Emmanuel Grumbach
2014-03-19 14:01 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).