mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
fix: avoid memory leak
Related-To: NEO-9038 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
08e92d154f
commit
83c306e927
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user