From 12ff2212f56ec9698043455c436d3259e55f80e6 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Mon, 13 Apr 2020 11:46:27 +0900 Subject: [PATCH] mm: mm_heap: Fix deadlock in mm_trysemaphore in SMP mode Signed-off-by: Masayuki Ishikawa --- mm/mm_heap/mm_sem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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