Kernel: if VFS initialization does not find root, we fail

This commit is contained in:
Bananymous 2023-03-09 02:17:42 +02:00
parent 392da37f9a
commit fc58baf54d
1 changed files with 9 additions and 1 deletions

View File

@ -16,7 +16,15 @@ namespace Kernel
s_instance = new VirtualFileSystem(); s_instance = new VirtualFileSystem();
if (s_instance == nullptr) if (s_instance == nullptr)
return BAN::Error::from_errno(ENOMEM); return BAN::Error::from_errno(ENOMEM);
return s_instance->initialize_impl();
if (auto res = s_instance->initialize_impl(); res.is_error())
{
delete s_instance;
s_instance = nullptr;
return res;
}
return {};
} }
VirtualFileSystem& VirtualFileSystem::get() VirtualFileSystem& VirtualFileSystem::get()