SWDEV-549707 - Fixed memleak in hipMemImportFromShareableHandle (#442)
Co-authored-by: Ioannis Assiouras <Ioannis.Assiouras@amd.com>
This commit is contained in:
committed by
GitHub
parent
621da5410a
commit
4d5db26646
@@ -260,8 +260,8 @@ hipError_t hipMemImportFromShareableHandle(hipMemGenericAllocationHandle_t* hand
|
|||||||
phys_mem_obj->getUserData().data = new hip::GenericAllocation(*phys_mem_obj, 0, prop);
|
phys_mem_obj->getUserData().data = new hip::GenericAllocation(*phys_mem_obj, 0, prop);
|
||||||
*handle = reinterpret_cast<hipMemGenericAllocationHandle_t>(phys_mem_obj->getUserData().data);
|
*handle = reinterpret_cast<hipMemGenericAllocationHandle_t>(phys_mem_obj->getUserData().data);
|
||||||
|
|
||||||
if (amd::MemObjMap::FindMemObj(phys_mem_obj->getSvmPtr())) {
|
if (!amd::MemObjMap::FindMemObj(phys_mem_obj->getSvmPtr())) {
|
||||||
amd::MemObjMap::RemoveMemObj(phys_mem_obj->getSvmPtr());
|
amd::MemObjMap::AddMemObj(phys_mem_obj->getSvmPtr(), phys_mem_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
HIP_RETURN(hipSuccess);
|
HIP_RETURN(hipSuccess);
|
||||||
|
|||||||
Reference in New Issue
Block a user