From: Erik Faye-Lund Date: Wed, 27 Nov 2019 16:22:24 +0000 (+0100) Subject: zink: do not try to destroy NULL-fence X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8772d95d40367a2e27aef2127213a99540625632;p=mesa.git zink: do not try to destroy NULL-fence 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 --- diff --git a/src/gallium/drivers/zink/zink_fence.c b/src/gallium/drivers/zink/zink_fence.c index ac761e667a3..72f1b6c5766 100644 --- a/src/gallium/drivers/zink/zink_fence.c +++ b/src/gallium/drivers/zink/zink_fence.c @@ -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) {