diff options
author | Dave Airlie <[email protected]> | 2017-07-24 03:45:03 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-07-24 04:41:36 +0100 |
commit | b7cc07432ac14b7edfae66fb346c0d164f66e480 (patch) | |
tree | 5564400b4bf3e5f7ac05672805c7733637a82c3c /src/amd/vulkan | |
parent | daaf7efb93f433fbc82ee1a7adaf663cb4f96337 (diff) |
radv: for external memory imports close the fd on import success
If we get an fd, we need to close it before returning.
Fixes CTS test dEQP-VK.api.external.memory.opaque_fd.dedicated.device_only.import_multiple_times
Fixes: b70829708a (radv: Implement VK_KHR_external_memory)
Reviewed-by: Jason Ekstrand <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 81053ac2164..619e0f2fbe4 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -2253,8 +2253,10 @@ VkResult radv_AllocateMemory( if (!mem->bo) { result = VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR; goto fail; - } else + } else { + close(import_info->fd); goto out_success; + } } uint64_t alloc_size = align_u64(pAllocateInfo->allocationSize, 4096); |