Merge pull request #7920 from bunnei/fix-unmap-pages

core: hle: kernel: KPageTable: Fix UnmapPages.
This commit is contained in:
bunnei 2022-02-21 13:38:52 -07:00 committed by GitHub
commit 8d46c3cc66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -681,9 +681,8 @@ ResultCode KPageTable::UnmapPages(VAddr addr, const KPageLinkedList& page_linked
VAddr cur_addr{addr}; VAddr cur_addr{addr};
for (const auto& node : page_linked_list.Nodes()) { for (const auto& node : page_linked_list.Nodes()) {
const std::size_t num_pages{(addr - cur_addr) / PageSize}; if (const auto result{Operate(cur_addr, node.GetNumPages(), KMemoryPermission::None,
if (const auto result{ OperationType::Unmap)};
Operate(addr, num_pages, KMemoryPermission::None, OperationType::Unmap)};
result.IsError()) { result.IsError()) {
return result; return result;
} }