1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

Kernel: Simplify OOM handling in ProcessProcFSTraits

This commit is contained in:
sin-ack 2021-08-15 08:31:21 +00:00 committed by Andreas Kling
parent 8269e1a197
commit 8d90ecb280

View file

@ -707,11 +707,7 @@ public:
public:
static KResultOr<NonnullRefPtr<ProcessProcFSTraits>> try_create(Badge<Process>, WeakPtr<Process> process)
{
auto result = adopt_ref_if_nonnull(new (nothrow) ProcessProcFSTraits(process));
if (!result)
return ENOMEM;
return result.release_nonnull();
return adopt_nonnull_ref_or_enomem(new (nothrow) ProcessProcFSTraits(process));
}
virtual InodeIndex component_index() const override;