mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
Kernel: Simplify OOM handling in ProcessProcFSTraits
This commit is contained in:
parent
8269e1a197
commit
8d90ecb280
1 changed files with 1 additions and 5 deletions
|
@ -707,11 +707,7 @@ public:
|
||||||
public:
|
public:
|
||||||
static KResultOr<NonnullRefPtr<ProcessProcFSTraits>> try_create(Badge<Process>, WeakPtr<Process> process)
|
static KResultOr<NonnullRefPtr<ProcessProcFSTraits>> try_create(Badge<Process>, WeakPtr<Process> process)
|
||||||
{
|
{
|
||||||
auto result = adopt_ref_if_nonnull(new (nothrow) ProcessProcFSTraits(process));
|
return adopt_nonnull_ref_or_enomem(new (nothrow) ProcessProcFSTraits(process));
|
||||||
if (!result)
|
|
||||||
return ENOMEM;
|
|
||||||
|
|
||||||
return result.release_nonnull();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual InodeIndex component_index() const override;
|
virtual InodeIndex component_index() const override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue