1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 08:57:35 +00:00

Kernel: Fix accidental overlaps in RegionTree::allocate_range_specific()

Thanks to Idan for spotting this! :^)
This commit is contained in:
Andreas Kling 2022-04-03 23:07:29 +02:00
parent 36d829b97c
commit 9765f9f67e

View file

@ -90,7 +90,7 @@ ErrorOr<VirtualRange> RegionTree::allocate_range_specific(VirtualAddress base, s
if (!m_total_range.contains(range))
return ENOMEM;
auto* region = m_regions.find_largest_not_above(base.get());
auto* region = m_regions.find_largest_not_above(base.offset(size).get());
if (!region) {
// The range can be accommodated below the current lowest range.
return range;