Skip to content

Commit

Permalink
mac80211: fix sw scan locking
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Oct 7, 2010
1 parent 4b34d43 commit 7b99a7c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,6 @@ void ieee80211_scan_work(struct work_struct *work)
goto out_complete;
}

mutex_unlock(&local->mtx);

/*
* as long as no delay is required advance immediately
* without scheduling a new work
Expand Down Expand Up @@ -713,6 +711,7 @@ void ieee80211_scan_work(struct work_struct *work)
} while (next_delay == 0);

ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay);
mutex_unlock(&local->mtx);
return;

out_complete:
Expand Down

0 comments on commit 7b99a7c

Please sign in to comment.