zink: do not try to destroy NULL-fence
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 27 Nov 2019 16:22:24 +0000 (17:22 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 29 Nov 2019 08:54:25 +0000 (09:54 +0100)
destroy_fence doesn't handle NULL-pointers gracefully. So let's avoid
hitting that code-path, by simply returning NULL early here instead.

CoverityID: 1455179
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/zink/zink_fence.c

index ac761e667a3a365f4410be6bc8899387d44e9ec2..72f1b6c57663a7e5134459b25edfd2bf3c732c4e 100644 (file)
@@ -46,7 +46,7 @@ zink_create_fence(struct pipe_screen *pscreen)
    struct zink_fence *ret = CALLOC_STRUCT(zink_fence);
    if (!ret) {
       debug_printf("CALLOC_STRUCT failed\n");
-      goto fail;
+      return NULL;
    }
 
    if (vkCreateFence(screen->dev, &fci, NULL, &ret->fence) != VK_SUCCESS) {