From ff201725eddfb48abe5a41e5b044087a8825f9d4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Jul 2019 07:33:37 -0400 Subject: [PATCH] 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(+) diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 6b2d78cc81..6ec4159cab 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