3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

scan: Reset sp.timeout in destroy callback

This commit is contained in:
Andrew Zaborowski 2019-05-01 17:32:32 +02:00 committed by Denis Kenzior
parent 09e31282b3
commit 2c33cf2b33

View File

@ -690,7 +690,6 @@ bool scan_periodic_stop(uint32_t ifindex)
if (sc->sp.timeout) { if (sc->sp.timeout) {
l_timeout_remove(sc->sp.timeout); l_timeout_remove(sc->sp.timeout);
sc->sp.timeout = NULL;
} }
sc->sp.interval = 0; sc->sp.interval = 0;
@ -719,6 +718,13 @@ static void scan_periodic_timeout(struct l_timeout *timeout, void *user_data)
start_next_scan_request(sc); start_next_scan_request(sc);
} }
static void scan_periodic_timeout_destroy(void *user_data)
{
struct scan_context *sc = user_data;
sc->sp.timeout = NULL;
}
static void scan_periodic_rearm(struct scan_context *sc) static void scan_periodic_rearm(struct scan_context *sc)
{ {
l_debug("Arming periodic scan timer: %u", sc->sp.interval); l_debug("Arming periodic scan timer: %u", sc->sp.interval);
@ -727,8 +733,8 @@ static void scan_periodic_rearm(struct scan_context *sc)
l_timeout_modify(sc->sp.timeout, sc->sp.interval); l_timeout_modify(sc->sp.timeout, sc->sp.interval);
else else
sc->sp.timeout = l_timeout_create(sc->sp.interval, sc->sp.timeout = l_timeout_create(sc->sp.interval,
scan_periodic_timeout, sc, NULL); scan_periodic_timeout, sc,
scan_periodic_timeout_destroy);
sc->sp.rearm = false; sc->sp.rearm = false;
} }