linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix sw scan locking
@ 2010-10-07 10:55 Johannes Berg
  2010-10-07 17:22 ` Ben Greear
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2010-10-07 10:55 UTC (permalink / raw)
  To: John Linville
  Cc: linux-wireless@vger.kernel.org, Ben Greear, Stanislaw Gruszka

From: Johannes Berg <johannes.berg@intel.com>

The recent scan overhaul broke locking
because now we can jump to code that
attempts to unlock, while we don't have
the mutex held. Fix this by holding the
mutex around all the relevant code.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/scan.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- wireless-testing.orig/net/mac80211/scan.c	2010-10-07 10:50:51.000000000 +0200
+++ wireless-testing/net/mac80211/scan.c	2010-10-07 10:51:10.000000000 +0200
@@ -682,8 +682,6 @@ void ieee80211_scan_work(struct work_str
 		goto out_complete;
 	}
 
-	mutex_unlock(&local->mtx);
-
 	/*
 	 * as long as no delay is required advance immediately
 	 * without scheduling a new work
@@ -714,6 +712,7 @@ void ieee80211_scan_work(struct work_str
 	} while (next_delay == 0);
 
 	ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay);
+	mutex_unlock(&local->mtx);
 	return;
 
 out_complete:



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

end of thread, other threads:[~2010-10-07 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-07 10:55 [PATCH] mac80211: fix sw scan locking Johannes Berg
2010-10-07 17:22 ` Ben Greear

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).