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

Kernel: Simplify OOM handling in ISO9660FileSystem

This commit is contained in:
sin-ack 2021-08-15 08:33:12 +00:00 committed by Andreas Kling
parent 8d90ecb280
commit 61c0e3ca92
2 changed files with 3 additions and 15 deletions

View file

@ -293,11 +293,7 @@ public:
static KResultOr<NonnullRefPtr<DirectoryEntry>> try_create(u32 extent, u32 length, OwnPtr<KBuffer> blocks)
{
auto result = adopt_ref_if_nonnull(new (nothrow) DirectoryEntry(extent, length, move(blocks)));
if (!result) {
return ENOMEM;
}
return result.release_nonnull();
return adopt_nonnull_ref_or_enomem(new (nothrow) DirectoryEntry(extent, length, move(blocks)));
}
private: