summaryrefslogtreecommitdiff
path: root/Kernel/Memory/AnonymousVMObject.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 16:13:10 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 16:25:40 +0200
commit3631ebe9638771401d8050781600755d814fe0d2 (patch)
treeb93daf44658a220b7ce99f86fb77559c3fa4c7c9 /Kernel/Memory/AnonymousVMObject.cpp
parentabb43468dcb44efe7e84ffc2f08b6b68c23f770b (diff)
downloadserenity-3631ebe9638771401d8050781600755d814fe0d2.zip
Kernel: Use TRY() in AnonymousVMObject
Diffstat (limited to 'Kernel/Memory/AnonymousVMObject.cpp')
-rw-r--r--Kernel/Memory/AnonymousVMObject.cpp6
1 files changed, 1 insertions, 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<NonnullRefPtr<VMObject>> 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;
}