1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

Kernel: Propagate failure to commit VM regions in more places

Ultimately we should not panic just because we can't fully commit a VM
region (by populating it with physical pages.)

This patch handles some of the situations where commit() can fail.
This commit is contained in:
Andreas Kling 2020-05-08 21:47:08 +02:00
parent 25db315b29
commit 042b1f6814
3 changed files with 12 additions and 12 deletions

View file

@ -358,8 +358,8 @@ OwnPtr<Region> MemoryManager::allocate_kernel_region(size_t size, const StringVi
auto region = allocate_kernel_region_with_vmobject(range, vmobject, name, access, user_accessible, cacheable);
if (!region)
return nullptr;
if (should_commit)
region->commit();
if (should_commit && !region->commit())
return nullptr;
return region;
}