anv: don't close invalid syncfd semaphore
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 6 Jan 2020 14:38:19 +0000 (16:38 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 8 Jan 2020 16:20:50 +0000 (18:20 +0200)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_queue.c

index 76fc93fde371ffc3e6424fb9b52cf51df751b470..40f1dc7c5fdaef6d9a6102d71fcddfb00c8f5fc4 100644 (file)
@@ -1847,7 +1847,8 @@ anv_semaphore_impl_cleanup(struct anv_device *device,
       break;
 
    case ANV_SEMAPHORE_TYPE_SYNC_FILE:
-      close(impl->fd);
+      if (impl->fd >= 0)
+         close(impl->fd);
       break;
 
    case ANV_SEMAPHORE_TYPE_TIMELINE: