mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
Kernel: Propagate overflow errors from Memory::page_round_up
Fixes #11402.
This commit is contained in:
parent
11599a3342
commit
33b78915d3
31 changed files with 112 additions and 100 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ ErrorOr<void> KCOVInstance::buffer_allocate(size_t buffer_size_in_entries)
|
|||
|
||||
// first entry contains index of last PC
|
||||
m_buffer_size_in_entries = buffer_size_in_entries - 1;
|
||||
m_buffer_size_in_bytes = Memory::page_round_up(buffer_size_in_entries * KCOV_ENTRY_SIZE);
|
||||
m_buffer_size_in_bytes = TRY(Memory::page_round_up(buffer_size_in_entries * KCOV_ENTRY_SIZE));
|
||||
|
||||
// one single vmobject is representing the buffer
|
||||
// - we allocate one kernel region using that vmobject
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue