1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:37:44 +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

@ -22,7 +22,8 @@ static constexpr u16 pcm_sample_rate_maximum = 48000;
static ErrorOr<OwnPtr<Memory::Region>> allocate_physical_buffer(size_t size, StringView name)
{
auto vmobject = TRY(Memory::AnonymousVMObject::try_create_physically_contiguous_with_size(Memory::page_round_up(size)));
auto rounded_size = TRY(Memory::page_round_up(size));
auto vmobject = TRY(Memory::AnonymousVMObject::try_create_physically_contiguous_with_size(rounded_size));
return TRY(MM.allocate_kernel_region_with_vmobject(move(vmobject), vmobject->size(), name, Memory::Region::Access::Write));
}