From 0a531eaa43cdd6ab15e60da2f4b203505265f5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Tue, 3 Dec 2024 08:47:13 +0000 Subject: Fix missing mutex unlock --- arch/x86_64/src/memory/heap/linked_list_allocator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/x86_64/src/memory') 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; } -- cgit v1.2.3