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 <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 3f7b6356fd]
This commit is contained in:
xinhui pan
2018-08-10 16:40:34 +08:00
committed by Xinhui Pan
vanhempi 17e104702a
commit 76f3da6bd0
@@ -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;
}
}