summaryrefslogtreecommitdiff
path: root/Kernel/VM
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-13 21:20:24 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-13 23:08:45 +0200
commitbf5e4326ac03264d503495b4b7b1996753d2bfe7 (patch)
tree196964c4f0c6570418cf60733fefd4656ebc34b9 /Kernel/VM
parente323942623b0e15d9a124f51a739de613119cf1e (diff)
downloadserenity-bf5e4326ac03264d503495b4b7b1996753d2bfe7.zip
Kernel: Fix bogus address calculation in initialize_physical_pages()
We were incorrectly using sizeof(PhysicalPageEntry) for some address calculations instead of sizeof(PageTableEntry). It still worked correctly because they happen to be the same size.
Diffstat (limited to 'Kernel/VM')
-rw-r--r--Kernel/VM/MemoryManager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index 3ed3d6b12c..9374a3dee7 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -460,7 +460,7 @@ UNMAP_AFTER_INIT void MemoryManager::initialize_physical_pages()
auto result = kernel_page_tables.set(virtual_page_array_current_page & ~0x1fffff, move(physical_page));
VERIFY(result == AK::HashSetResult::InsertedNewEntry);
- virtual_page_array_current_page += (PAGE_SIZE / sizeof(PhysicalPageEntry)) * PAGE_SIZE;
+ virtual_page_array_current_page += (PAGE_SIZE / sizeof(PageTableEntry)) * PAGE_SIZE;
}
dmesgln("MM: Physical page entries: {}", range.value());