mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 10:36:04 +08:00
[HUST CSE IoTS&P Lab] [fix] check rt_mutex_create return value (#7169)
This commit is contained in:
@@ -1016,6 +1016,8 @@ rt_err_t sys_sem_release(rt_sem_t sem)
|
||||
rt_mutex_t sys_mutex_create(const char *name, rt_uint8_t flag)
|
||||
{
|
||||
rt_mutex_t mutex = rt_mutex_create(name, flag);
|
||||
if(mutex == NULL)
|
||||
return NULL;
|
||||
if (lwp_user_object_add(lwp_self(), (rt_object_t)mutex) != 0)
|
||||
{
|
||||
rt_mutex_delete(mutex);
|
||||
|
||||
Reference in New Issue
Block a user