Kernel: Allow kmalloc(..) / kmalloc_aligned(..) to return nullptr

Now that we have a significant amount of code paths handling OOM, lets
enable kmalloc and friends to actually return nullptr. This way we can
start stressing these paths and validating all of they work as expected.
This commit is contained in:
Brian Gianforcaro 2021-08-13 01:32:48 -07:00 committed by Andreas Kling
commit e7fb70b05c
Notes: sideshowbarker 2024-07-18 07:02:20 +09:00
2 changed files with 4 additions and 5 deletions

View file

@ -255,9 +255,6 @@ void* kmalloc(size_t size)
}
void* ptr = g_kmalloc_global->m_heap.allocate(size);
if (!ptr) {
PANIC("kmalloc: Out of memory (requested size: {})", size);
}
Thread* current_thread = Thread::current();
if (!current_thread)