From 96cc9a92794309d83f03a34d34a6f2f24a68ac3e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Jul 2019 07:33:37 -0400 Subject: kernel/vm_manager: Correct behavior in failure case of UnmapPhysicalMemory() If an unmapping operation fails, we shouldn't be decrementing the amount of memory mapped and returning that the operation was successful. We should actually be returning the error code in this case. --- src/core/hle/kernel/vm_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 6b2d78cc8..6ec4159ca 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -447,6 +447,8 @@ ResultCode VMManager::UnmapPhysicalMemory(VAddr target, u64 size) { map_size, MemoryState::Heap, VMAPermission::None); ASSERT_MSG(remap_res.Succeeded(), "Failed to remap a memory block."); } + + return result; } // Update mapped amount -- cgit v1.2.3