Kernel: Make SharedInodeVMObject allocation OOM-safe

This commit is contained in:
Andreas Kling 2021-07-11 17:52:07 +02:00
parent 59049ae4b7
commit af8c74a328
Notes: sideshowbarker 2024-07-18 09:19:25 +09:00
4 changed files with 17 additions and 6 deletions

View file

@ -97,7 +97,7 @@ KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& descriptio
// FIXME: If PROT_EXEC, check that the underlying file system isn't mounted noexec.
RefPtr<InodeVMObject> vmobject;
if (shared)
vmobject = SharedInodeVMObject::create_with_inode(inode());
vmobject = SharedInodeVMObject::try_create_with_inode(inode());
else
vmobject = PrivateInodeVMObject::create_with_inode(inode());
if (!vmobject)