Thread (26 messages) 26 messages, 2 authors, 2017-11-09
STALE3140d

[PATCH 09/23] adapter: Clear timeout handle when check presence timer stopped

From: Mark Greer <mgreer@animalcreek.com>
Date: 2017-06-15 18:25:30
Subsystem: the rest · Maintainer: Linus Torvalds

__near_adapter_stop_check_presence() stops the neard check presence
timer but doesn't clear the timer handle.  This can cause neard to
try to stop the timer when it isn't running.  To fix that, clear the
handle so neard doesn't try to stop an already stopped timer.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
---
 src/adapter.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/adapter.c b/src/adapter.c
index 466753b..7be87e2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -505,8 +505,10 @@ void __near_adapter_stop_check_presence(uint32_t adapter_idx,
 	if (!adapter)
 		return;
 
-	if (adapter->presence_timeout > 0)
+	if (adapter->presence_timeout > 0) {
 		g_source_remove(adapter->presence_timeout);
+		adapter->presence_timeout = 0;
+	}
 }
 
 static const GDBusMethodTable adapter_methods[] = {
-- 
2.13.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help