radv: fix destroying the syncobj when exporting a fence FD
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 14 Jul 2020 20:55:04 +0000 (22:55 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Jul 2020 21:04:37 +0000 (21:04 +0000)
It's invalid and the temporary syncobj was never actually destroyed.

Cc: 20.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5921>

src/amd/vulkan/radv_device.c

index e1e3c0b8a85f72a6f0d39914ca37d840d8e0725a..09a89b8be74fd8286f990f62821327a3c620be8f 100644 (file)
@@ -7237,7 +7237,7 @@ VkResult radv_GetFenceFdKHR(VkDevice _device,
                ret = device->ws->export_syncobj_to_sync_file(device->ws, syncobj_handle, pFd);
                if (!ret) {
                        if (fence->temp_syncobj) {
-                               close (fence->temp_syncobj);
+                               device->ws->destroy_syncobj(device->ws, fence->temp_syncobj);
                                fence->temp_syncobj = 0;
                        } else {
                                device->ws->reset_syncobj(device->ws, syncobj_handle);