Search Linux Wireless

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



__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@xxxxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux