mm/mm_heap/mm_check_heap_corruption : Move mm_givesemaphore for matching mm_takesemaphore
mm_takesemaphore is in for loop about traversing heap region, but mm_givesemaphore is out of that for loop.
In this case, semaphore can not be matched, so moved it into for loop.
@@ -223,7 +223,6 @@ int mm_check_heap_corruption(struct mm_heap_s *heap)
}
}
}
- }
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
if (!up_interrupt_context())
@@ -231,6 +230,7 @@ int mm_check_heap_corruption(struct mm_heap_s *heap)
{
mm_givesemaphore(heap);
}
+ }
return 0;
}
