Kernel: Tidy up DevFS construction and handle OOM errorso

- Use KResultOr and TRY() to propagate errors
- Check for OOM
- Move allocations out of the DevFS constructor
This commit is contained in:
Andreas Kling 2021-09-06 10:47:47 +02:00
commit 788b91a65c
Notes: sideshowbarker 2024-07-18 04:37:37 +09:00
3 changed files with 16 additions and 21 deletions

View file

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