Kernel: Use TRY() in sys$map_time_page()

This commit is contained in:
Andreas Kling 2021-09-05 18:01:22 +02:00
parent d53c60fd9f
commit 6dddd500bf
Notes: sideshowbarker 2024-07-18 04:41:21 +09:00

View file

@ -21,11 +21,8 @@ KResultOr<FlatPtr> Process::sys$map_time_page()
if (!range.has_value())
return ENOMEM;
auto region_or_error = address_space().allocate_region_with_vmobject(range.value(), vmobject, 0, "Kernel time page"sv, PROT_READ, true);
if (region_or_error.is_error())
return region_or_error.error();
return region_or_error.value()->vaddr().get();
auto* region = TRY(address_space().allocate_region_with_vmobject(range.value(), vmobject, 0, "Kernel time page"sv, PROT_READ, true));
return region->vaddr().get();
}
KResultOr<FlatPtr> Process::sys$clock_gettime(clockid_t clock_id, Userspace<timespec*> user_ts)