diff --git a/Kernel/Syscalls/chmod.cpp b/Kernel/Syscalls/chmod.cpp index 21502d6ce5..f7fd0c439d 100644 --- a/Kernel/Syscalls/chmod.cpp +++ b/Kernel/Syscalls/chmod.cpp @@ -14,10 +14,8 @@ KResultOr Process::sys$chmod(Userspace user_path, size_t p { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this); REQUIRE_PROMISE(fattr); - auto path = get_syscall_path_argument(user_path, path_length); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().chmod(path.value()->view(), mode, current_directory()); + auto path = TRY(get_syscall_path_argument(user_path, path_length)); + return VirtualFileSystem::the().chmod(path->view(), mode, current_directory()); } KResultOr Process::sys$fchmod(int fd, mode_t mode)