1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:15:07 +00:00

Kernel: Actually fix accidental overlaps in allocate_range_specific()

Thanks to Idan for spotting this! :^)
This commit is contained in:
Andreas Kling 2022-04-03 23:58:57 +02:00
parent 5506932788
commit db75bab493

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.offset(size).get());
auto* region = m_regions.find_largest_not_above(base.offset(size - 1).get());
if (!region) {
// The range can be accommodated below the current lowest range.
return range;