mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
Kernel: Use static_ptr_cast to convert between Userspace<T*> types
Some calls of copy_to_user were converting Userspace<T*> to Userspace<U*> via the implicit conversion to FlatPtr. Change them to use the static_ptr_cast overload that is designed to express this conversion
This commit is contained in:
parent
194456efdc
commit
7243bcb7da
Notes:
sideshowbarker
2024-07-18 01:05:50 +09:00
Author: https://github.com/ADKaster
Commit: 7243bcb7da
Pull-request: https://github.com/SerenityOS/serenity/pull/10925
4 changed files with 5 additions and 5 deletions
|
@ -74,7 +74,7 @@ ErrorOr<void> InodeFile::ioctl(OpenFileDescription& description, unsigned reques
|
|||
}
|
||||
case FIONREAD: {
|
||||
int remaining_bytes = inode().size() - description.offset();
|
||||
return copy_to_user(Userspace<int*>(arg), &remaining_bytes);
|
||||
return copy_to_user(static_ptr_cast<int*>(arg), &remaining_bytes);
|
||||
}
|
||||
default:
|
||||
return EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue