mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
Kernel: Make copy_{from,to}_user() return KResult and use TRY()
This makes EFAULT propagation flow much more naturally. :^)
This commit is contained in:
parent
9903f5c6ef
commit
48a0b31c47
57 changed files with 318 additions and 551 deletions
|
@ -127,9 +127,7 @@ KResult SB16::ioctl(FileDescription&, unsigned request, Userspace<void*> arg)
|
|||
switch (request) {
|
||||
case SOUNDCARD_IOCTL_GET_SAMPLE_RATE: {
|
||||
auto output = static_ptr_cast<u16*>(arg);
|
||||
if (!copy_to_user(output, &m_sample_rate))
|
||||
return EFAULT;
|
||||
return KSuccess;
|
||||
return copy_to_user(output, &m_sample_rate);
|
||||
}
|
||||
case SOUNDCARD_IOCTL_SET_SAMPLE_RATE: {
|
||||
auto sample_rate_value = static_cast<u16>(arg.ptr());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue