Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c70ca8cb authored by Andreas Fenkart's avatar Andreas Fenkart Committed by Kalle Valo
Browse files

mwifiex: factor out mwifiex_cancel_pending_scan_cmd



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>
parent 948ad6b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment