mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-18 00:02:01 +00:00
Kernel: Make Process::allocate_region*() return KResultOr<Region*>
This allows region allocation to return specific errors and we don't have to assume every failure is an ENOMEM.
This commit is contained in:
parent
7899e14e72
commit
64b0d89335
Notes:
sideshowbarker
2024-07-18 23:51:04 +09:00
Author: https://github.com/awesomekling
Commit: 64b0d89335
10 changed files with 70 additions and 79 deletions
|
@ -47,11 +47,7 @@ KResultOr<Region*> AnonymousFile::mmap(Process& process, FileDescription&, Virtu
|
|||
if (size != m_vmobject->size())
|
||||
return KResult(-EINVAL);
|
||||
|
||||
auto* region = process.allocate_region_with_vmobject(preferred_vaddr, size, m_vmobject, offset, {}, prot, shared);
|
||||
if (!region)
|
||||
return KResult(-ENOMEM);
|
||||
|
||||
return region;
|
||||
return process.allocate_region_with_vmobject(preferred_vaddr, size, m_vmobject, offset, {}, prot, shared);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue