From 7c0b2eb0f5beb7936699a8d0dc7eeeb2427910dc Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Fri, 28 May 2021 05:42:03 -0700 Subject: [PATCH] Kernel: Handle OOM of file system in sys$mount --- Kernel/Syscalls/mount.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp index 917d6968b4..237bb48a01 100644 --- a/Kernel/Syscalls/mount.cpp +++ b/Kernel/Syscalls/mount.cpp @@ -95,6 +95,9 @@ KResultOr Process::sys$mount(Userspace use return ENODEV; } + if (!fs) + return ENOMEM; + if (!fs->initialize()) { dbgln("mount: failed to initialize {} filesystem, fd={}", fs_type, source_fd); return ENODEV;