]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix ibss race
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 11 Oct 2009 09:47:57 +0000 (11:47 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 12 Oct 2009 19:55:52 +0000 (15:55 -0400)
commit99386f5b8d6e63dd75976382783275f14becd7f3
treed39f829ab22aff38791a0c13e05eab985598ef6e
parent7ba18ce280349b61fee258d67c8961482038b149
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>
net/mac80211/ibss.c