From 3631ebe9638771401d8050781600755d814fe0d2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 16:13:10 +0200 Subject: [PATCH] Kernel: Use TRY() in AnonymousVMObject --- Kernel/Memory/AnonymousVMObject.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Kernel/Memory/AnonymousVMObject.cpp b/Kernel/Memory/AnonymousVMObject.cpp index 8a5559eb53..8789eaae55 100644 --- a/Kernel/Memory/AnonymousVMObject.cpp +++ b/Kernel/Memory/AnonymousVMObject.cpp @@ -21,11 +21,7 @@ KResultOr> AnonymousVMObject::try_clone() if (is_purgeable() && is_volatile()) { // If this object is purgeable+volatile, create a new zero-filled purgeable+volatile // object, effectively "pre-purging" it in the child process. - auto maybe_clone = try_create_purgeable_with_size(size(), AllocationStrategy::None); - if (maybe_clone.is_error()) - return maybe_clone.error(); - - auto clone = maybe_clone.release_value(); + auto clone = TRY(try_create_purgeable_with_size(size(), AllocationStrategy::None)); clone->m_volatile = true; return clone; }