diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index f9444595e8..5bfcb5fec3 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -30,12 +30,15 @@ KResultOr Process::sys$mount(Userspace return EFAULT; auto source_fd = params.source_fd; - auto target = copy_string_from_user(params.target); - if (target.is_null()) - return EFAULT; - auto fs_type = copy_string_from_user(params.fs_type); - if (fs_type.is_null()) - return EFAULT; + auto target_or_error = try_copy_kstring_from_user(params.target); + if (target_or_error.is_error()) + return target_or_error.error(); + auto fs_type_or_error = try_copy_kstring_from_user(params.fs_type); + if (fs_type_or_error.is_error()) + return fs_type_or_error.error(); + + auto target = target_or_error.value()->view(); + auto fs_type = fs_type_or_error.value()->view(); auto description = fds().file_description(source_fd); if (!description.is_null())