summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 18:15:42 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 18:15:42 +0200
commit53aa01384d3dfe7fabccb823d6527879c54dd15e (patch)
treeeefc05a2531d633e64e029f22394b957d881ee8d
parentbfe4c845419f0770b400f656709750f7248a5f1b (diff)
downloadserenity-53aa01384d3dfe7fabccb823d6527879c54dd15e.zip
Kernel: Use TRY() in sys$set_coredump_metadata()
-rw-r--r--Kernel/Syscalls/process.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/Kernel/Syscalls/process.cpp b/Kernel/Syscalls/process.cpp
index 4832dcaf5c..6c2e69cfe9 100644
--- a/Kernel/Syscalls/process.cpp
+++ b/Kernel/Syscalls/process.cpp
@@ -59,14 +59,8 @@ KResultOr<FlatPtr> Process::sys$set_coredump_metadata(Userspace<const Syscall::S
return EINVAL;
if (params.value.length > 16 * KiB)
return EINVAL;
- auto key_or_error = try_copy_kstring_from_user(params.key);
- if (key_or_error.is_error())
- return key_or_error.error();
- auto key = key_or_error.release_value();
- auto value_or_error = try_copy_kstring_from_user(params.value);
- if (value_or_error.is_error())
- return value_or_error.error();
- auto value = value_or_error.release_value();
+ auto key = TRY(try_copy_kstring_from_user(params.key));
+ auto value = TRY(try_copy_kstring_from_user(params.value));
return set_coredump_property(move(key), move(value));
}