From 8d90ecb280502998c5cc50fffad1e95e4f4cea85 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Sun, 15 Aug 2021 08:31:21 +0000 Subject: Kernel: Simplify OOM handling in ProcessProcFSTraits --- Kernel/Process.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Kernel/Process.h') 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> try_create(Badge, WeakPtr 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; -- cgit v1.2.3