From 76f3da6bd0ba888eea19bc7b64e19507e19785ea Mon Sep 17 00:00:00 2001 From: xinhui pan Date: Fri, 10 Aug 2018 16:40:34 +0800 Subject: [PATCH] kfdtest: fix a memory leak issue in MMapLarge test When mapMemoryToGpu fails, we need unregister it with user address as the gpu address is not available. Change-Id: I4418eeaa7aa37008f5bffa144e2c2171f0d238fd Signed-off-by: xinhui pan [ROCm/ROCR-Runtime commit: 3f7b6356fdc122847de1a32de4c00a8ddbd97575] --- projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp index 6f12caed65..8282106420 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDMemoryTest.cpp @@ -168,7 +168,7 @@ TEST_F(KFDMemoryTest, MMapLarge) { break; if (hsaKmtMapMemoryToGPUNodes(addr + i, s - i, &AlternateVAGPU[i], mapFlags, 1, (HSAuint32 *)&defaultGPUNode)) { - hsaKmtDeregisterMemory((void*)AlternateVAGPU[i]); + hsaKmtDeregisterMemory(addr + i); break; } }