diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-15 17:27:52 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-15 19:10:30 +0100 |
commit | 64b0d89335cc2517cf0024efdb7dc20bca5ec9d9 (patch) | |
tree | e1af7a8dd5549a879fd8662614b759d52c467434 /Kernel/FileSystem/InodeFile.cpp | |
parent | 7899e14e723cd00d54bd08f4f27fe2ce8f9ccf4f (diff) | |
download | serenity-64b0d89335cc2517cf0024efdb7dc20bca5ec9d9.zip |
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.
Diffstat (limited to 'Kernel/FileSystem/InodeFile.cpp')
-rw-r--r-- | Kernel/FileSystem/InodeFile.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Kernel/FileSystem/InodeFile.cpp b/Kernel/FileSystem/InodeFile.cpp index c0c1c5f830..58a3f2459e 100644 --- a/Kernel/FileSystem/InodeFile.cpp +++ b/Kernel/FileSystem/InodeFile.cpp @@ -79,10 +79,7 @@ KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptio vmobject = PrivateInodeVMObject::create_with_inode(inode()); if (!vmobject) return KResult(-ENOMEM); - auto* region = process.allocate_region_with_vmobject(preferred_vaddr, size, *vmobject, offset, description.absolute_path(), prot, shared); - if (!region) - return KResult(-ENOMEM); - return region; + return process.allocate_region_with_vmobject(preferred_vaddr, size, *vmobject, offset, description.absolute_path(), prot, shared); } String InodeFile::absolute_path(const FileDescription& description) const |