SWDEV-458026 - Check for hsa_handle/svm_ptr before removing from MemObjMap.

Change-Id: I967735c01c6321eeb768963ecb88667dbbe92f08


[ROCm/clr commit: fa4c1a0206]
This commit is contained in:
kjayapra-amd
2024-05-15 09:59:46 -04:00
committed by Karthik Jayaprakash
parent bc5a2e3b1e
commit 6f2179d9d8
+3 -1
View File
@@ -247,7 +247,9 @@ hipError_t hipMemImportFromShareableHandle(hipMemGenericAllocationHandle_t* hand
phys_mem_obj->getUserData().data = new hip::GenericAllocation(*phys_mem_obj, 0, prop);
*handle = reinterpret_cast<hipMemGenericAllocationHandle_t>(phys_mem_obj->getUserData().data);
amd::MemObjMap::RemoveMemObj(phys_mem_obj->getSvmPtr());
if (amd::MemObjMap::FindMemObj(phys_mem_obj->getSvmPtr())) {
amd::MemObjMap::RemoveMemObj(phys_mem_obj->getSvmPtr());
}
HIP_RETURN(hipSuccess);
}