Kernel: Use TRY() in sys$set_thread_name()

This commit is contained in:
Andreas Kling 2021-09-05 18:11:19 +02:00
parent afc5bbd56b
commit 257fa80312
Notes: sideshowbarker 2024-07-18 04:41:02 +09:00

View File

@ -177,10 +177,7 @@ KResultOr<FlatPtr> Process::sys$set_thread_name(pid_t tid, Userspace<const char*
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
REQUIRE_PROMISE(stdio);
auto name_or_error = try_copy_kstring_from_user(user_name, user_name_length);
if (name_or_error.is_error())
return name_or_error.error();
auto name = name_or_error.release_value();
auto name = TRY(try_copy_kstring_from_user(user_name, user_name_length));
const size_t max_thread_name_size = 64;
if (name->length() > max_thread_name_size)