From 0e16099d44a690bb7445b3b2231bb106d6887f8c Mon Sep 17 00:00:00 2001 From: Jeff Sullivan Date: Tue, 7 Nov 2023 17:53:46 +0900 Subject: icd: Unmap mapped memory before freeing it --- scripts/mock_icd_generator.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index 499669f8..ea5c2f61 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -1497,6 +1497,8 @@ class MockICDOutputGenerator(OutputGenerator): elif True in [ftxt in api_function_name for ftxt in ['Destroy', 'Free']]: self.appendSection('command', '//Destroy object') if 'FreeMemory' in api_function_name: + # If the memory is mapped, unmap it + self.appendSection('command', ' UnmapMemory(device, memory);') # Remove from allocation map self.appendSection('command', ' unique_lock_t lock(global_lock);') self.appendSection('command', ' allocated_memory_size_map.erase(memory);') -- cgit v1.2.3