From c767e20f911953cbc85e8d1bc4679b508699bc0d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 16:13:56 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$chown() --- Kernel/Syscalls/chown.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Kernel/Syscalls/chown.cpp b/Kernel/Syscalls/chown.cpp index 7a36c0c2b8..7056f73ff6 100644 --- a/Kernel/Syscalls/chown.cpp +++ b/Kernel/Syscalls/chown.cpp @@ -26,10 +26,8 @@ KResultOr Process::sys$chown(Userspace Syscall::SC_chown_params params; if (!copy_from_user(¶ms, user_params)) return EFAULT; - auto path = get_syscall_path_argument(params.path); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().chown(path.value()->view(), params.uid, params.gid, current_directory()); + auto path = TRY(get_syscall_path_argument(params.path)); + return VirtualFileSystem::the().chown(path->view(), params.uid, params.gid, current_directory()); } }