summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-17 15:44:58 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-18 21:11:30 +0100
commit0f22ba5bf2a1393ac011ad4d09aa0cefce946be9 (patch)
treeefdfeaff596a29e0614739772f37a02b1661172c /Kernel
parentb285323d91819f67677552701bb4b853859267bd (diff)
downloadserenity-0f22ba5bf2a1393ac011ad4d09aa0cefce946be9.zip
AK: Make RedBlackTree::try_insert() return ErrorOr<void> instead of bool
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Memory/AddressSpace.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Kernel/Memory/AddressSpace.cpp b/Kernel/Memory/AddressSpace.cpp
index 6f3e54d313..d936be2b40 100644
--- a/Kernel/Memory/AddressSpace.cpp
+++ b/Kernel/Memory/AddressSpace.cpp
@@ -267,8 +267,7 @@ ErrorOr<Region*> AddressSpace::add_region(NonnullOwnPtr<Region> region)
{
auto* ptr = region.ptr();
SpinlockLocker lock(m_lock);
- if (!m_regions.try_insert(region->vaddr().get(), move(region)))
- return ENOMEM;
+ TRY(m_regions.try_insert(region->vaddr().get(), move(region)));
return ptr;
}