1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

Kernel: Assert on OOM in Region::commit()

This function has a lot of callers that don't bother checking if it
returns successfully or not. We'll need to handle failure in a bunch
of places and then we can remove this assertion.
This commit is contained in:
Andreas Kling 2020-05-06 21:10:29 +02:00
parent 43593455db
commit c633c1c2ea

View file

@ -137,6 +137,7 @@ bool Region::commit(size_t page_index)
auto physical_page = MM.allocate_user_physical_page(MemoryManager::ShouldZeroFill::Yes);
if (!physical_page) {
klog() << "MM: commit was unable to allocate a physical page";
ASSERT_NOT_REACHED();
return false;
}
vmobject_physical_page_entry = move(physical_page);