• J
    wl1271: Fix scan race condition · 76a029fb
    Juuso Oikarinen 提交于
    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: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
    Reviewed-by: NSaravanan Dhanabal <ext-saravanan.dhanabal@nokia.com>
    Signed-off-by: NLuciano Coelho <luciano.coelho@nokia.com>
    76a029fb
wl1271_scan.c 6.5 KB