Kernel: Make PerformanceEventBuffer creation API OOM safe
This commit is contained in:
parent
8fc6168f21
commit
ab63449ab7
Notes:
sideshowbarker
2024-07-18 17:15:04 +09:00
Author: https://github.com/bgianfo Commit: https://github.com/SerenityOS/serenity/commit/ab63449ab77 Pull-request: https://github.com/SerenityOS/serenity/pull/7520 Reviewed-by: https://github.com/supercomputer7
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,7 @@ OwnPtr<PerformanceEventBuffer> PerformanceEventBuffer::try_create_with_size(size
|
|||
auto buffer = KBuffer::try_create_with_size(buffer_size, Region::Access::Read | Region::Access::Write, "Performance events", AllocationStrategy::AllocateNow);
|
||||
if (!buffer)
|
||||
return {};
|
||||
return adopt_own(*new PerformanceEventBuffer(buffer.release_nonnull()));
|
||||
return adopt_own_if_nonnull(new PerformanceEventBuffer(buffer.release_nonnull()));
|
||||
}
|
||||
|
||||
void PerformanceEventBuffer::add_process(const Process& process, ProcessEventType event_type)
|
||||
|
|
Loading…
Add table
Reference in a new issue