summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/keymap.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 17:51:37 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 17:51:37 +0200
commit789db813d397f476452d2ecce140385e1600a8c7 (patch)
tree745f79aa8d3f3045983666183b307777da0325e5 /Kernel/Syscalls/keymap.cpp
parentd7e5768763ff39201761e7c4dfb07cd18c724344 (diff)
downloadserenity-789db813d397f476452d2ecce140385e1600a8c7.zip
Kernel: Use copy_typed_from_user<T> for fetching syscall parameters
Diffstat (limited to 'Kernel/Syscalls/keymap.cpp')
-rw-r--r--Kernel/Syscalls/keymap.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Kernel/Syscalls/keymap.cpp b/Kernel/Syscalls/keymap.cpp
index 2359ff6745..1b68b0a6a3 100644
--- a/Kernel/Syscalls/keymap.cpp
+++ b/Kernel/Syscalls/keymap.cpp
@@ -19,8 +19,7 @@ KResultOr<FlatPtr> Process::sys$setkeymap(Userspace<const Syscall::SC_setkeymap_
if (!is_superuser())
return EPERM;
- Syscall::SC_setkeymap_params params;
- TRY(copy_from_user(&params, user_params));
+ auto params = TRY(copy_typed_from_user(user_params));
Keyboard::CharacterMapData character_map_data;
@@ -44,9 +43,7 @@ KResultOr<FlatPtr> Process::sys$getkeymap(Userspace<const Syscall::SC_getkeymap_
{
VERIFY_NO_PROCESS_BIG_LOCK(this);
REQUIRE_PROMISE(getkeymap);
-
- Syscall::SC_getkeymap_params params {};
- TRY(copy_from_user(&params, user_params));
+ auto params = TRY(copy_typed_from_user(user_params));
String keymap_name = HIDManagement::the().keymap_name();
const Keyboard::CharacterMapData& character_maps = HIDManagement::the().character_maps();