mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
Kernel/Syscalls: Use copy_n_to_user when applicable
copy_to_user() with bytes as the last argument could be changed to using copy_n_to_user() with a count.
This commit is contained in:
parent
f32fde6152
commit
d0ac24ddbf
5 changed files with 10 additions and 9 deletions
|
@ -131,7 +131,7 @@ ErrorOr<FlatPtr> Process::sys$poll(Userspace<Syscall::SC_poll_params const*> use
|
|||
}
|
||||
|
||||
if (params.nfds > 0)
|
||||
TRY(copy_to_user(¶ms.fds[0], fds_copy.data(), params.nfds * sizeof(pollfd)));
|
||||
TRY(copy_n_to_user(¶ms.fds[0], fds_copy.data(), params.nfds));
|
||||
|
||||
return fds_with_revents;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue