mm/mm_heap/mm_sem.c: add getpid() return check in mm_trysemaphore()

Change-Id: Ifd56e3ccc22cf0a50f52e643b7a87aab0d0dca06
Signed-off-by: ligd <liguiding@fishsemi.com>
This commit is contained in:
ligd 2020-04-08 16:03:01 +08:00 committed by patacongo
parent afe08b666c
commit 78eb9f73dd

View File

@ -174,6 +174,11 @@ int mm_trysemaphore(FAR struct mm_heap_s *heap)
* 'else', albeit with a nonsensical PID value. * 'else', albeit with a nonsensical PID value.
*/ */
if (my_pid < 0)
{
return my_pid;
}
/* Does the current task already hold the semaphore? Is the current /* Does the current task already hold the semaphore? Is the current
* task actually running? * task actually running?
*/ */