aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2024-12-03 08:47:13 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-12-03 08:47:13 +0000
commit0a531eaa43cdd6ab15e60da2f4b203505265f5c6 (patch)
tree99e2ab4c790b22a52858c20eb23e233f0bb2fc08
parent23526b8d10cf41ad5598928bf2bf3264539d497f (diff)
downloadteachos-0a531eaa43cdd6ab15e60da2f4b203505265f5c6.tar.xz
teachos-0a531eaa43cdd6ab15e60da2f4b203505265f5c6.zip
Fix missing mutex unlock
-rw-r--r--arch/x86_64/src/memory/heap/linked_list_allocator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86_64/src/memory/heap/linked_list_allocator.cpp b/arch/x86_64/src/memory/heap/linked_list_allocator.cpp
index 6600c6e..d0bf8e6 100644
--- a/arch/x86_64/src/memory/heap/linked_list_allocator.cpp
+++ b/arch/x86_64/src/memory/heap/linked_list_allocator.cpp
@@ -36,11 +36,13 @@ namespace teachos::arch::memory::heap
{
if (current->size == size)
{
- return remove_free_memory_block(previous, current);
+ auto const memory_address = remove_free_memory_block(previous, current);
+ mutex.unlock();
+ return memory_address;
}
else if (current->size >= size + min_allocatable_size())
{
- auto memory_address = split_free_memory_block(previous, current, size);
+ auto const memory_address = split_free_memory_block(previous, current, size);
mutex.unlock();
return memory_address;
}