diff --git a/sched/semaphore/sem_post.c b/sched/semaphore/sem_post.c index d5fd3842df..851c5f2f7f 100644 --- a/sched/semaphore/sem_post.c +++ b/sched/semaphore/sem_post.c @@ -151,7 +151,10 @@ int nxsem_post(FAR sem_t *sem) /* Stop the watchdog timer */ - wd_cancel(&stcb->waitdog); + if (WDOG_ISACTIVE(&stcb->waitdog)) + { + wd_cancel(&stcb->waitdog); + } /* Restart the waiting task. */