mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +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)
|
if (!events_buffer)
|
||||||
return KSuccess;
|
return KSuccess;
|
||||||
|
|
||||||
auto string_or_error = try_copy_kstring_from_user(user_string, user_string_length);
|
auto string = TRY(try_copy_kstring_from_user(user_string, user_string_length));
|
||||||
if (string_or_error.is_error())
|
return events_buffer->register_string(move(string));
|
||||||
return string_or_error.error();
|
|
||||||
|
|
||||||
return events_buffer->register_string(string_or_error.release_value());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue