mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel: Return ENOMEM on allocation failures in FramebufferDevice::mmap
This commit is contained in:
parent
41c0009f6d
commit
2df4d977e2
1 changed files with 11 additions and 0 deletions
|
@ -43,9 +43,20 @@ KResultOr<Region*> FramebufferDevice::mmap(Process& process, FileDescription&, c
|
|||
m_userspace_real_framebuffer_vmobject = vmobject;
|
||||
|
||||
m_real_framebuffer_vmobject = AnonymousVMObject::try_create_for_physical_range(m_framebuffer_address, page_round_up(framebuffer_size_in_bytes()));
|
||||
if (!m_real_framebuffer_vmobject)
|
||||
return ENOMEM;
|
||||
|
||||
m_swapped_framebuffer_vmobject = AnonymousVMObject::try_create_with_size(page_round_up(framebuffer_size_in_bytes()), AllocationStrategy::AllocateNow);
|
||||
if (!m_swapped_framebuffer_vmobject)
|
||||
return ENOMEM;
|
||||
|
||||
m_real_framebuffer_region = MM.allocate_kernel_region_with_vmobject(*m_real_framebuffer_vmobject, page_round_up(framebuffer_size_in_bytes()), "Framebuffer", Region::Access::Read | Region::Access::Write);
|
||||
if (!m_real_framebuffer_region)
|
||||
return ENOMEM;
|
||||
|
||||
m_swapped_framebuffer_region = MM.allocate_kernel_region_with_vmobject(*m_swapped_framebuffer_vmobject, page_round_up(framebuffer_size_in_bytes()), "Framebuffer Swap (Blank)", Region::Access::Read | Region::Access::Write);
|
||||
if (!m_swapped_framebuffer_region)
|
||||
return ENOMEM;
|
||||
|
||||
RefPtr<VMObject> chosen_vmobject;
|
||||
if (m_graphical_writes_enabled) {
|
||||
|
|
Loading…
Add table
Reference in a new issue