summaryrefslogtreecommitdiff
path: root/Kernel/VM/PrivateInodeVMObject.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-28 03:18:07 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-29 09:04:05 +0200
commit65d5f81afc6b5820dded3ff09ca8cdfe6b57acef (patch)
treeab01378e9c208e00a907e18d6114a30a9ccbde7e /Kernel/VM/PrivateInodeVMObject.cpp
parentd947253c51c68d7a59e9128432e053d699487033 (diff)
downloadserenity-65d5f81afc6b5820dded3ff09ca8cdfe6b57acef.zip
Kernel: Make PrivateInodeVMObject factory APIs OOM safe
Diffstat (limited to 'Kernel/VM/PrivateInodeVMObject.cpp')
-rw-r--r--Kernel/VM/PrivateInodeVMObject.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/VM/PrivateInodeVMObject.cpp b/Kernel/VM/PrivateInodeVMObject.cpp
index 18aa0fb21f..1ddd894089 100644
--- a/Kernel/VM/PrivateInodeVMObject.cpp
+++ b/Kernel/VM/PrivateInodeVMObject.cpp
@@ -9,14 +9,14 @@
namespace Kernel {
-NonnullRefPtr<PrivateInodeVMObject> PrivateInodeVMObject::create_with_inode(Inode& inode)
+RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::create_with_inode(Inode& inode)
{
- return adopt_ref(*new PrivateInodeVMObject(inode, inode.size()));
+ return adopt_ref_if_nonnull(new PrivateInodeVMObject(inode, inode.size()));
}
RefPtr<VMObject> PrivateInodeVMObject::clone()
{
- return adopt_ref(*new PrivateInodeVMObject(*this));
+ return adopt_ref_if_nonnull(new PrivateInodeVMObject(*this));
}
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)