From d53c60fd9fb53980f0a150c4568d874c173fa47f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 18:00:31 +0200 Subject: Kernel: Use TRY() in sys$setkeymap() --- Kernel/Syscalls/keymap.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Kernel/Syscalls/keymap.cpp') diff --git a/Kernel/Syscalls/keymap.cpp b/Kernel/Syscalls/keymap.cpp index 1b68b0a6a3..665508456c 100644 --- a/Kernel/Syscalls/keymap.cpp +++ b/Kernel/Syscalls/keymap.cpp @@ -29,13 +29,11 @@ KResultOr Process::sys$setkeymap(Userspacelength() > map_name_max_size) + auto map_name = TRY(get_syscall_path_argument(params.map_name)); + if (map_name->length() > map_name_max_size) return ENAMETOOLONG; - HIDManagement::the().set_maps(character_map_data, map_name.value()->view()); + HIDManagement::the().set_maps(character_map_data, map_name->view()); return 0; } -- cgit v1.2.3