diff --git a/kernel/src/memory/PMM.cpp b/kernel/src/memory/PMM.cpp index 3f9d8dd9..aa167b57 100644 --- a/kernel/src/memory/PMM.cpp +++ b/kernel/src/memory/PMM.cpp @@ -2,6 +2,7 @@ #include "memory/PMM.h" #include "bootboot.h" +#include "log/Log.h" #include "memory/Memory.h" #include "memory/MemoryManager.h" #include "misc/utils.h" @@ -130,7 +131,11 @@ void* PMM::request_pages(uint64_t count) void PMM::free_page(void* address) { uint64_t index = (uint64_t)address / PAGE_SIZE; - if (index > (bitmap_size * 8)) return; + if (index > (bitmap_size * 8)) + { + kinfoln("attempt to free out-of-range address %p", address); + return; + } if (!bitmap_read(index)) return; bitmap_set(index, false); used_mem -= PAGE_SIZE;