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

Kernel: Remove false condition in RegionTree::allocate_range_specific

Since find_largest_not_above returns the highest region that is below
the end of the request range, no region after it can intersect with it.
This commit is contained in:
Idan Horowitz 2022-04-04 01:02:33 +03:00 committed by Andreas Kling
parent f943e97b76
commit 30e6b313b4

View file

@ -101,20 +101,6 @@ ErrorOr<VirtualRange> RegionTree::allocate_range_specific(VirtualAddress base, s
return ENOMEM;
}
auto it = m_regions.begin_from(region->vaddr().get());
VERIFY(!it.is_end());
++it;
if (it.is_end()) {
// The range can be accommodated above the nearest range.
return range;
}
if (it->range().intersects(range)) {
// Requested range overlaps the next neighbor.
return ENOMEM;
}
// Requested range fits between first region and its next neighbor.
return range;
}