]> git.baikalelectronics.ru Git - kernel.git/commit
wl1271: Fix scan race condition
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Thu, 29 Jul 2010 01:54:45 +0000 (04:54 +0300)
committerLuciano Coelho <luciano.coelho@nokia.com>
Tue, 28 Sep 2010 09:15:05 +0000 (12:15 +0300)
commit552ac0d150336e51103322fa2085f654f9943d9a
treeb5e27bc9faba4bfda46af1e23cef4a19a2d896b6
parenteb72025bc3cd73d49eae79712d0f99d8e9a7112d
wl1271: Fix scan race condition

In the scan state machine, the wl1271_mutex is unlocked first then relocked,
and then the scan state variables are modified.

This makes it possible for ieee80211_scan_complete to be called twice in some
scenarios, as the scan completion event from the firmware may be processed
while the mutex is unlocked.

To fix the issue, move the ieee80211_scan_complete call last in the function.
This is generally safer, but there still may be issues is functions calling
the scan state machine rely on states checked before the unlocking of the
global mutex.

(forward ported from 2.6.32 -- this is not strictly needed anymore, because
the mutex doesn't need to be unlocked anymore, but I'm applying this change
anyway, so that the call to ieee80211_scan_complete is in the same place)

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Saravanan Dhanabal <ext-saravanan.dhanabal@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
drivers/net/wireless/wl12xx/wl1271_main.c
drivers/net/wireless/wl12xx/wl1271_scan.c