Fixed close fd after calling drm ioctl prime fd to handle

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
Slawomir Milczarek
2020-11-16 12:12:55 +01:00
committed by Compute-Runtime-Automation
parent 0f42ef1ed7
commit 4ca1784712
2 changed files with 5 additions and 2 deletions

View File

@@ -572,8 +572,6 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
return nullptr;
}
closeFunction(openFd.fd);
auto boHandle = openFd.handle;
auto bo = findAndReferenceSharedBufferObject(boHandle);
@@ -588,6 +586,8 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
pushSharedBufferObject(bo);
}
closeFunction(handle);
lock.unlock();
auto drmAllocation = new DrmAllocation(properties.rootDeviceIndex, properties.allocationType, bo, reinterpret_cast<void *>(bo->gpuAddress), bo->size,