mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
Kernel: Add copy_typed_from_user for non-const Userspace<T*>
This commit is contained in:
parent
46c6176fad
commit
d69a0380e1
Notes:
sideshowbarker
2024-07-17 04:45:50 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/d69a0380e1 Pull-request: https://github.com/SerenityOS/serenity/pull/15895 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/LucasChollet Reviewed-by: https://github.com/tslater2006
1 changed files with 8 additions and 0 deletions
|
@ -171,3 +171,11 @@ inline ErrorOr<T> copy_typed_from_user(Userspace<T const*> user_data)
|
|||
TRY(copy_from_user(&data, user_data));
|
||||
return data;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline ErrorOr<T> copy_typed_from_user(Userspace<T*> user_data)
|
||||
{
|
||||
T data {};
|
||||
TRY(copy_from_user(&data, user_data));
|
||||
return data;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue