From 748938ea5914383b6b18b7429a219bdcca876d64 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Sat, 14 Aug 2021 12:39:51 +0000 Subject: Kernel: Handle allocation failure in ProcFS and friends There were many places in which allocation failure was noticed but ignored. --- Kernel/Syscalls/mount.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Kernel/Syscalls') 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 Process::sys$mount(Userspace 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) { -- cgit v1.2.3