Commit 51f98f1313d2fc4b1d3a3e1f4db7cf4925b29df6

Authored by Johannes Berg
Committed by John W. Linville
1 parent 5e4708bcb5

mac80211: fix ibss race

When a scan completes, we call ieee80211_sta_find_ibss(),
which is also called from other places. When the scan was
done in software, there's no problem as both run from the
single-threaded mac80211 workqueue and are thus serialised
against each other, but with hardware scan the completion
can be in a different context and race against callers of
this function from the workqueue (e.g. due to beacon RX).
So instead of calling ieee80211_sta_find_ibss() directly,
just arm the timer and have it fire, scheduling the work,
which will invoke ieee80211_sta_find_ibss() (if that is
appropriate in the current state).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -829,7 +829,7 @@
829 829 if (!sdata->u.ibss.ssid_len)
830 830 continue;
831 831 sdata->u.ibss.last_scan_completed = jiffies;
832   - ieee80211_sta_find_ibss(sdata);
  832 + mod_timer(&sdata->u.ibss.timer, 0);
833 833 }
834 834 mutex_unlock(&local->iflist_mtx);
835 835 }