summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index b37837fc98..a5d1bc9c1c 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -707,11 +707,7 @@ public:
public:
static KResultOr<NonnullRefPtr<ProcessProcFSTraits>> try_create(Badge<Process>, WeakPtr<Process> process)
{
- auto result = adopt_ref_if_nonnull(new (nothrow) ProcessProcFSTraits(process));
- if (!result)
- return ENOMEM;
-
- return result.release_nonnull();
+ return adopt_nonnull_ref_or_enomem(new (nothrow) ProcessProcFSTraits(process));
}
virtual InodeIndex component_index() const override;