diff --git a/components/drivers/ipc/workqueue.c b/components/drivers/ipc/workqueue.c index cb958c8710..984c36323f 100644 --- a/components/drivers/ipc/workqueue.c +++ b/components/drivers/ipc/workqueue.c @@ -252,6 +252,7 @@ struct rt_workqueue *rt_workqueue_create(const char *name, rt_uint16_t stack_siz queue->work_thread = rt_thread_create(name, _workqueue_thread_entry, queue, stack_size, priority, 10); if (queue->work_thread == RT_NULL) { + rt_sem_detach(&(queue->sem)); RT_KERNEL_FREE(queue); return RT_NULL; }