mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 03:32:42 +01:00
scan: Fix crash
Sometimes the periodic scan is started and stopped before the timeout was created. If periodic_scan_stop was called before, the timeout object was not reset to NULL, which can lead to a crash.
This commit is contained in:
parent
fc68ece8d2
commit
97be0e87c3
@ -487,7 +487,11 @@ bool scan_periodic_stop(uint32_t ifindex)
|
||||
|
||||
l_debug("Stopping periodic scan for ifindex: %u", ifindex);
|
||||
|
||||
l_timeout_remove(sc->sp.timeout);
|
||||
if (sc->sp.timeout) {
|
||||
l_timeout_remove(sc->sp.timeout);
|
||||
sc->sp.timeout = NULL;
|
||||
}
|
||||
|
||||
sc->sp.interval = 0;
|
||||
sc->sp.callback = NULL;
|
||||
sc->sp.userdata = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user