From c633c1c2eab688284d9339a8c6dfab525e776aca Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 6 May 2020 21:10:29 +0200 Subject: [PATCH] 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. --- Kernel/VM/Region.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp index 4bed703219..27f0655cef 100644 --- a/Kernel/VM/Region.cpp +++ b/Kernel/VM/Region.cpp @@ -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);