summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-28 05:42:03 -0700
committerLinus Groh <mail@linusgroh.de>2021-06-01 23:14:40 +0100
commit7c0b2eb0f5beb7936699a8d0dc7eeeb2427910dc (patch)
tree97e9d88554132934a71584a054b1e2ce058095aa /Kernel/Syscalls
parentcbe1e057713869254ba7f18daf63e6341230e984 (diff)
downloadserenity-7c0b2eb0f5beb7936699a8d0dc7eeeb2427910dc.zip
Kernel: Handle OOM of file system in sys$mount
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/mount.cpp3
1 files changed, 3 insertions, 0 deletions
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<int> Process::sys$mount(Userspace<const Syscall::SC_mount_params*> use
return ENODEV;
}
+ if (!fs)
+ return ENOMEM;
+
if (!fs->initialize()) {
dbgln("mount: failed to initialize {} filesystem, fd={}", fs_type, source_fd);
return ENODEV;