• Andreas Fenkart's avatar
    mwifiex: factor out mwifiex_cancel_pending_scan_cmd · c70ca8cb
    Andreas Fenkart authored
    Releasing the scan_pending lock in mwifiex_check_next_scan_command
    introduces a short window where pending scan commands can be removed
    or added before removing them all in mwifiex_cancel_pending_scan_cmd.
    I think this is safe, since the worst thing to happen is that a
    pending scan cmd is removed by the command handler. Adding new scan
    commands is not possible while one is pending, see scan_processing flag.
    Since all commands are removed from the queue anyway, we don't care if
    some commands are removed by a different code path earlier, the final
    state remains the same.
    I assume, that the critical section needed for the check has been
    extended over clearing the pending scan queue out of convenience. The
    lock was already held and releasing it and grab it again was just
    more work. It doesn't seem to be necessary because of concurrency.
    Signed-off-by: default avatarAndreas Fenkart <afenkart@gmail.com>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    c70ca8cb
sta_cmdresp.c 36.5 KB