fix: avoid memory leak

Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-10-04 16:11:47 +00:00
committed by Compute-Runtime-Automation
parent 08e92d154f
commit 83c306e927
5 changed files with 17 additions and 16 deletions

View File

@@ -634,11 +634,15 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData &
bo->setAddress(gpuRange);
auto allocation = new DrmAllocation(allocationData.rootDeviceIndex, allocationData.type, bo.get(), nullptr, gpuRange, bufferSize, MemoryPool::SystemCpuInaccessible);
if (!allocation) {
return nullptr;
}
bo.release();
allocation->setDefaultGmm(gmm.release());
allocation->setReservedAddressRange(reinterpret_cast<void *>(gpuRange), bufferSize);
bo.release();
return allocation;
}