You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2019/04/02 21:13:28 UTC

[mynewt-core] branch master updated: timesched: chk timer is non-empty before removing (#1736)

This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new af8e28e  timesched: chk timer is non-empty before removing (#1736)
af8e28e is described below

commit af8e28e4538e11240f0bd9bddf4a6c9e7b6cad83
Author: Vipul Rahane <vr...@gmail.com>
AuthorDate: Tue Apr 2 14:13:23 2019 -0700

    timesched: chk timer is non-empty before removing (#1736)
---
 time/timesched/src/timesched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/time/timesched/src/timesched.c b/time/timesched/src/timesched.c
index 4ec39d2..2efc5c9 100644
--- a/time/timesched/src/timesched.c
+++ b/time/timesched/src/timesched.c
@@ -140,7 +140,9 @@ timesched_timer_stop(struct timesched_timer *timer)
 
     OS_ENTER_CRITICAL(sr);
 
-    TAILQ_REMOVE(&g_timesched_q, timer, link);
+    if (timer->link.tqe_prev != NULL) {
+        TAILQ_REMOVE(&g_timesched_q, timer, link);
+    }
 
     OS_EXIT_CRITICAL(sr);