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 <jason@jlekstrand.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie
2017-07-24 03:45:03 +01:00
parent daaf7efb93
commit b7cc07432a
+3 -1
View File
@@ -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);