From 5f71925aa42ca3c5665d66ec5ada87494ad0a885 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 12 Jan 2022 14:49:44 +0100 Subject: [PATCH] Kernel: Actually clear page slots in Region::clear_to_zero() We were copying the RefPtr and zeroing the copy instead of zeroing the slot itself. --- Kernel/Memory/Region.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Memory/Region.cpp b/Kernel/Memory/Region.cpp index 76e31d7406..e4254c7184 100644 --- a/Kernel/Memory/Region.cpp +++ b/Kernel/Memory/Region.cpp @@ -306,7 +306,7 @@ void Region::clear_to_zero() VERIFY(vmobject().is_anonymous()); SpinlockLocker locker(vmobject().m_lock); for (auto i = 0u; i < page_count(); ++i) { - auto page = physical_page_slot(i); + auto& page = physical_page_slot(i); VERIFY(page); if (page->is_shared_zero_page()) continue;