sched/wqueue: do work_cancel when worker is not null

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-01-11 14:12:20 +08:00 committed by Xiang Xiao
parent 22fa59074f
commit 63039b80e1
1 changed files with 4 additions and 1 deletions

View File

@ -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. */