From 2ab8fd89fc63864b25d0b7e33f247c8e50ba68e9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 14:02:36 +0200 Subject: [PATCH] Kernel: Simplify Process::get_syscall_path_argument() --- Kernel/Process.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index c7dc4ad184..045d769928 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -544,10 +544,7 @@ KResultOr> Process::get_syscall_path_argument(Userspace PATH_MAX) return ENAMETOOLONG; - auto string_or_error = try_copy_kstring_from_user(user_path, path_length); - if (string_or_error.is_error()) - return string_or_error.error(); - return string_or_error.release_value(); + return try_copy_kstring_from_user(user_path, path_length); } KResultOr> Process::get_syscall_path_argument(Syscall::StringArgument const& path) const