[Mesa-dev] [PATCH] radv: for external memory imports close the fd on import success
From: Dave Airlie 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) Signed-off-by: Dave Airlie --- src/amd/vulkan/radv_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 3f83b61..40b2f34 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); -- 2.9.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radv: for external memory imports close the fd on import success
Reciewed-by: Jason Ekstrand On July 23, 2017 7:51:44 PM Dave Airlie wrote: From: Dave Airlie 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) Signed-off-by: Dave Airlie --- src/amd/vulkan/radv_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 3f83b61..40b2f34 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); -- 2.9.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] radv: for external memory imports close the fd on import success
Reviewed-by: Bas Nieuwenhuizen On Mon, Jul 24, 2017 at 4:51 AM, Dave Airlie wrote: > From: Dave Airlie > > 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) > Signed-off-by: Dave Airlie > --- > src/amd/vulkan/radv_device.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c > index 3f83b61..40b2f34 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); > -- > 2.9.4 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev