diff options
Diffstat (limited to 'Kernel/Memory/ScatterGatherList.cpp')
-rw-r--r-- | Kernel/Memory/ScatterGatherList.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Kernel/Memory/ScatterGatherList.cpp b/Kernel/Memory/ScatterGatherList.cpp index 1eb9b6e53b..f49237c2d9 100644 --- a/Kernel/Memory/ScatterGatherList.cpp +++ b/Kernel/Memory/ScatterGatherList.cpp @@ -8,14 +8,10 @@ namespace Kernel::Memory { -LockRefPtr<ScatterGatherList> ScatterGatherList::try_create(AsyncBlockDeviceRequest& request, Span<NonnullRefPtr<PhysicalPage>> allocated_pages, size_t device_block_size) +ErrorOr<LockRefPtr<ScatterGatherList>> ScatterGatherList::try_create(AsyncBlockDeviceRequest& request, Span<NonnullRefPtr<PhysicalPage>> allocated_pages, size_t device_block_size) { - auto maybe_vm_object = AnonymousVMObject::try_create_with_physical_pages(allocated_pages); - if (maybe_vm_object.is_error()) { - // FIXME: Would be nice to be able to return a ErrorOr here. - return {}; - } - return adopt_lock_ref_if_nonnull(new (nothrow) ScatterGatherList(maybe_vm_object.release_value(), request, device_block_size)); + auto vm_object = TRY(AnonymousVMObject::try_create_with_physical_pages(allocated_pages)); + return adopt_lock_ref_if_nonnull(new (nothrow) ScatterGatherList(vm_object, request, device_block_size)); } ScatterGatherList::ScatterGatherList(NonnullLockRefPtr<AnonymousVMObject> vm_object, AsyncBlockDeviceRequest& request, size_t device_block_size) |