summaryrefslogtreecommitdiff
path: root/Kernel/Devices/BXVGADevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Devices/BXVGADevice.cpp')
-rw-r--r--Kernel/Devices/BXVGADevice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Devices/BXVGADevice.cpp b/Kernel/Devices/BXVGADevice.cpp
index 714096f586..47730d9936 100644
--- a/Kernel/Devices/BXVGADevice.cpp
+++ b/Kernel/Devices/BXVGADevice.cpp
@@ -116,10 +116,12 @@ KResultOr<Region*> BXVGADevice::mmap(Process& process, FileDescription&, Virtual
ASSERT(offset == 0);
ASSERT(size == framebuffer_size_in_bytes());
auto vmobject = AnonymousVMObject::create_for_physical_range(m_framebuffer_address, framebuffer_size_in_bytes());
+ if (!vmobject)
+ return KResult(-ENOMEM);
auto* region = process.allocate_region_with_vmobject(
preferred_vaddr,
framebuffer_size_in_bytes(),
- move(vmobject),
+ vmobject.release_nonnull(),
0,
"BXVGA Framebuffer",
prot);