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

Change-Id: I967735c01c6321eeb768963ecb88667dbbe92f08
This commit is contained in:
kjayapra-amd authored and Karthik Jayaprakash committed 2024-06-01 17:50:54 -04:00
1 orang tua 4fb06f94d1
melakukan fa4c1a0206
1 file changed
+3 -1
+3 -1
Melihat 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);
}