mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
Kernel: Simplify OOM handling in ProcessProcFSTraits
This commit is contained in:
parent
8269e1a197
commit
8d90ecb280
Notes:
sideshowbarker
2024-07-18 05:39:39 +09:00
Author: https://github.com/sin-ack Commit: https://github.com/SerenityOS/serenity/commit/8d90ecb2805 Pull-request: https://github.com/SerenityOS/serenity/pull/9434 Reviewed-by: https://github.com/awesomekling
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue