From abdd4605257eaeb9ea1a58449583cdffebfdd2ab Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 7 Mar 2023 22:16:52 +0100 Subject: [PATCH] tmpfs: use adopt_shared_if_nonnull instead of plain adopt_shared in FileSystem::create() --- kernel/src/fs/tmpfs/FileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/fs/tmpfs/FileSystem.cpp b/kernel/src/fs/tmpfs/FileSystem.cpp index 772433cc..b0f2df99 100644 --- a/kernel/src/fs/tmpfs/FileSystem.cpp +++ b/kernel/src/fs/tmpfs/FileSystem.cpp @@ -7,7 +7,7 @@ namespace TmpFS { Result> FileSystem::create() { - SharedPtr fs = TRY(adopt_shared(new (std::nothrow) FileSystem())); + SharedPtr fs = TRY(adopt_shared_if_nonnull(new (std::nothrow) FileSystem())); SharedPtr root = TRY(fs->create_dir_inode({})); fs->set_root(root); return (SharedPtr)fs;