SWDEV-549707 - Fixed memleak in hipMemImportFromShareableHandle (#442)

Co-authored-by: Ioannis Assiouras <Ioannis.Assiouras@amd.com>
This commit is contained in:
systems-assistant[bot]
2025-08-20 19:28:59 +01:00
committed by GitHub
orang tua 621da5410a
melakukan 4d5db26646
+2 -2
Melihat File
@@ -260,8 +260,8 @@ 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);
if (amd::MemObjMap::FindMemObj(phys_mem_obj->getSvmPtr())) {
amd::MemObjMap::RemoveMemObj(phys_mem_obj->getSvmPtr());
if (!amd::MemObjMap::FindMemObj(phys_mem_obj->getSvmPtr())) {
amd::MemObjMap::AddMemObj(phys_mem_obj->getSvmPtr(), phys_mem_obj);
}
HIP_RETURN(hipSuccess);