summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorsin-ack <sin-ack@users.noreply.github.com>2021-08-14 12:39:51 +0000
committerAndreas Kling <kling@serenityos.org>2021-08-15 02:27:13 +0200
commit748938ea5914383b6b18b7429a219bdcca876d64 (patch)
treee0d34e022f96b60e1de552c62eccfe5e222eca0d /Kernel/Syscalls
parent134dbe2607fecc597b1ad72642f0f26d92677030 (diff)
downloadserenity-748938ea5914383b6b18b7429a219bdcca876d64.zip
Kernel: Handle allocation failure in ProcFS and friends
There were many places in which allocation failure was noticed but ignored.
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/mount.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Kernel/Syscalls/mount.cpp b/Kernel/Syscalls/mount.cpp
index f8a6d8f30b..757c117c1c 100644
--- a/Kernel/Syscalls/mount.cpp
+++ b/Kernel/Syscalls/mount.cpp
@@ -90,7 +90,10 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
fs = Plan9FS::create(*description);
} else if (fs_type == "proc"sv || fs_type == "ProcFS"sv) {
- fs = ProcFS::create();
+ auto maybe_fs = ProcFS::try_create();
+ if (maybe_fs.is_error())
+ return maybe_fs.error();
+ fs = maybe_fs.release_value();
} else if (fs_type == "devpts"sv || fs_type == "DevPtsFS"sv) {
fs = DevPtsFS::create();
} else if (fs_type == "dev"sv || fs_type == "DevFS"sv) {