diff --git a/sched/wqueue/kwork_queue.c b/sched/wqueue/kwork_queue.c index b21fe75f1f..493b540c4e 100644 --- a/sched/wqueue/kwork_queue.c +++ b/sched/wqueue/kwork_queue.c @@ -118,7 +118,10 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker, /* Remove the entry from the timer and work queue. */ - work_cancel(qid, work); + if (work->worker != NULL) + { + work_cancel(qid, work); + } /* Initialize the work structure. */