Kernel: Tidy up DevPtsFS construction and handle OOM errors

- Use KResultOr and TRY() to propagate errors
- Check for OOM when creating new inodes
This commit is contained in:
Andreas Kling 2021-09-06 10:42:09 +02:00
commit efe4e230ee
Notes: sideshowbarker 2024-07-18 04:37:40 +09:00
3 changed files with 6 additions and 11 deletions

View file

@ -81,7 +81,7 @@ KResultOr<FlatPtr> Process::sys$mount(Userspace<const Syscall::SC_mount_params*>
} else if (fs_type == "proc"sv || fs_type == "ProcFS"sv) {
fs = TRY(ProcFS::try_create());
} else if (fs_type == "devpts"sv || fs_type == "DevPtsFS"sv) {
fs = DevPtsFS::create();
fs = TRY(DevPtsFS::try_create());
} else if (fs_type == "dev"sv || fs_type == "DevFS"sv) {
fs = DevFS::create();
} else if (fs_type == "sys"sv || fs_type == "SysFS"sv) {