mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Kernel: Use TRY() in sys$perf_register_string()
This commit is contained in:
parent
77b7a44691
commit
17933b193a
1 changed files with 2 additions and 5 deletions
|
@ -25,11 +25,8 @@ KResultOr<FlatPtr> Process::sys$perf_register_string(Userspace<char const*> user
|
|||
if (!events_buffer)
|
||||
return KSuccess;
|
||||
|
||||
auto string_or_error = try_copy_kstring_from_user(user_string, user_string_length);
|
||||
if (string_or_error.is_error())
|
||||
return string_or_error.error();
|
||||
|
||||
return events_buffer->register_string(string_or_error.release_value());
|
||||
auto string = TRY(try_copy_kstring_from_user(user_string, user_string_length));
|
||||
return events_buffer->register_string(move(string));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue