Kernel: Add copy_typed_from_user for non-const Userspace<T*>

This commit is contained in:
Liav A 2022-10-29 22:14:49 +03:00 committed by Andrew Kaster
parent 46c6176fad
commit d69a0380e1
Notes: sideshowbarker 2024-07-17 04:45:50 +09:00

View file

@ -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;
}