mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Kernel: Fail with ENOMEM if there's insufficient VM for a SharedBuffer
This commit is contained in:
parent
30a8991dbf
commit
cb9d9846e0
1 changed files with 2 additions and 0 deletions
|
@ -88,6 +88,8 @@ void* SharedBuffer::ref_for_process_and_get_address(Process& process)
|
|||
if (ref.pid == process.pid()) {
|
||||
if (!ref.region) {
|
||||
auto* region = process.allocate_region_with_vmobject(VirtualAddress(), size(), m_vmobject, 0, "SharedBuffer", PROT_READ | (m_writable ? PROT_WRITE : 0));
|
||||
if (!region)
|
||||
return (void*)-ENOMEM;
|
||||
ref.region = region->make_weak_ptr();
|
||||
ref.region->set_shared(true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue