1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

Kernel: Handle allocation failure in ProcFS and friends

There were many places in which allocation failure was noticed but
ignored.
This commit is contained in:
sin-ack 2021-08-14 12:39:51 +00:00 committed by Andreas Kling
parent 134dbe2607
commit 748938ea59
8 changed files with 196 additions and 92 deletions

View file

@ -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) {