1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

Kernel: Propagate overflow errors from Memory::page_round_up

Fixes #11402.
This commit is contained in:
Guilherme Goncalves 2021-12-24 11:22:11 -03:00 committed by Andreas Kling
parent 11599a3342
commit 33b78915d3
31 changed files with 112 additions and 100 deletions

View file

@ -226,7 +226,11 @@ struct KmallocGlobalData {
if (padded_allocation_request.has_overflow()) {
PANIC("Integer overflow during kmalloc heap expansion");
}
size_t new_subheap_size = max(minimum_subheap_size, Memory::page_round_up(padded_allocation_request.value()));
auto rounded_allocation_request = Memory::page_round_up(padded_allocation_request.value());
if (rounded_allocation_request.is_error()) {
PANIC("Integer overflow computing pages for kmalloc heap expansion");
}
size_t new_subheap_size = max(minimum_subheap_size, rounded_allocation_request.value());
dbgln("Unable to allocate {}, expanding kmalloc heap", allocation_request);