core/memory: Fix error on virtual queries of reserved regions

This commit is contained in:
Daniel R. 2024-08-14 15:18:46 +02:00 committed by Daniel R
parent 27cb218584
commit 6cc4a682fd
No known key found for this signature in database
GPG Key ID: B8ADC8F57BA18DBA
1 changed files with 2 additions and 2 deletions

View File

@ -273,10 +273,10 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags,
std::scoped_lock lk{mutex}; std::scoped_lock lk{mutex};
auto it = FindVMA(addr); auto it = FindVMA(addr);
if (!it->second.IsMapped() && flags == 1) { if (it->second.type == VMAType::Free && flags == 1) {
it++; it++;
} }
if (!it->second.IsMapped()) { if (it->second.type == VMAType::Free) {
LOG_WARNING(Kernel_Vmm, "VirtualQuery on free memory region"); LOG_WARNING(Kernel_Vmm, "VirtualQuery on free memory region");
return ORBIS_KERNEL_ERROR_EACCES; return ORBIS_KERNEL_ERROR_EACCES;
} }