Kernel: Use TRY() in sys$perf_register_string()
This commit is contained in:
parent
77b7a44691
commit
17933b193a
Notes:
sideshowbarker
2024-07-18 04:41:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/17933b193a4
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
Reference in a new issue