[kernel] Fix frame allocator next-block bug

The frame allocator was causing page faults when exhausting the first
(well, last, because it starts from the end) block of free pages. Turns
out it was just incrementing instead of decrementing and thus running
off the end.
This commit is contained in:
Justin C. Miller
2021-02-06 00:06:29 -08:00
parent 572fade7ff
commit eb8a3c0e09

View File

@@ -32,7 +32,7 @@ bsf(uint64_t v)
size_t size_t
frame_allocator::allocate(size_t count, uintptr_t *address) frame_allocator::allocate(size_t count, uintptr_t *address)
{ {
for (long i = m_count - 1; i >= 0; ++i) { for (long i = m_count - 1; i >= 0; --i) {
frame_block &block = m_blocks[i]; frame_block &block = m_blocks[i];
if (!block.map1) if (!block.map1)