summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/Memory/AddressSpace.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Kernel/Memory/AddressSpace.cpp b/Kernel/Memory/AddressSpace.cpp
index a4379186b8..ea47ee91a3 100644
--- a/Kernel/Memory/AddressSpace.cpp
+++ b/Kernel/Memory/AddressSpace.cpp
@@ -321,10 +321,12 @@ void AddressSpace::remove_all_regions(Badge<Process>)
{
VERIFY(Thread::current() == g_finalizer);
SpinlockLocker locker(m_lock);
- SpinlockLocker pd_locker(m_page_directory->get_lock());
- SpinlockLocker mm_locker(s_mm_lock);
- for (auto& region : m_regions)
- (*region).unmap_with_locks_held(Region::ShouldDeallocateVirtualRange::No, ShouldFlushTLB::No, pd_locker, mm_locker);
+ {
+ SpinlockLocker pd_locker(m_page_directory->get_lock());
+ SpinlockLocker mm_locker(s_mm_lock);
+ for (auto& region : m_regions)
+ (*region).unmap_with_locks_held(Region::ShouldDeallocateVirtualRange::No, ShouldFlushTLB::No, pd_locker, mm_locker);
+ }
m_regions.clear();
}