diff options
Diffstat (limited to 'Kernel/Syscalls/mmap.cpp')
-rw-r--r-- | Kernel/Syscalls/mmap.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp index 92e6340a81..7b0e691fb5 100644 --- a/Kernel/Syscalls/mmap.cpp +++ b/Kernel/Syscalls/mmap.cpp @@ -223,9 +223,7 @@ KResultOr<FlatPtr> Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> u return EINVAL; if (static_cast<size_t>(offset) & ~PAGE_MASK) return EINVAL; - auto description = fds().file_description(fd); - if (!description) - return EBADF; + auto description = TRY(fds().file_description(fd)); if (description->is_directory()) return ENODEV; // Require read access even when read protection is not requested. |