summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 14:02:36 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 14:08:12 +0200
commit2ab8fd89fc63864b25d0b7e33f247c8e50ba68e9 (patch)
treefffd7767a623acd6ea0ece9bc8f85e88ccef81b1
parentf30eae7e7a011cb0a17ccbf9d150b155c4d7624c (diff)
downloadserenity-2ab8fd89fc63864b25d0b7e33f247c8e50ba68e9.zip
Kernel: Simplify Process::get_syscall_path_argument()
-rw-r--r--Kernel/Process.cpp5
1 files changed, 1 insertions, 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<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Userspace<c
return EINVAL;
if (path_length > 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<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Syscall::StringArgument const& path) const