diff --git a/Kernel/Syscalls/mknod.cpp b/Kernel/Syscalls/mknod.cpp index 7fb599dc47..89f9bba8b6 100644 --- a/Kernel/Syscalls/mknod.cpp +++ b/Kernel/Syscalls/mknod.cpp @@ -19,10 +19,8 @@ KResultOr Process::sys$mknod(Userspace return EFAULT; if (!is_superuser() && !is_regular_file(params.mode) && !is_fifo(params.mode) && !is_socket(params.mode)) return EPERM; - auto path = get_syscall_path_argument(params.path); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().mknod(path.value()->view(), params.mode & ~umask(), params.dev, current_directory()); + auto path = TRY(get_syscall_path_argument(params.path)); + return VirtualFileSystem::the().mknod(path->view(), params.mode & ~umask(), params.dev, current_directory()); } }