diff --git a/mm/mm_heap/mm_sem.c b/mm/mm_heap/mm_sem.c index abe41e2b7c..94e6665f48 100644 --- a/mm/mm_heap/mm_sem.c +++ b/mm/mm_heap/mm_sem.c @@ -179,7 +179,8 @@ int mm_trysemaphore(FAR struct mm_heap_s *heap) if (my_pid < 0) { - return my_pid; + ret = my_pid; + goto errout; } /* Does the current task already hold the semaphore? Is the current