[components/dirver]Fix issue of not releasing sem resource

This commit is contained in:
zms123456 2024-03-20 08:01:49 +08:00 committed by GitHub
parent bc85f5aaf4
commit 5e26b4c585
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}