From: Eric Engestrom Date: Wed, 19 Oct 2016 23:09:11 +0000 (+0100) Subject: wsi/wayland: fix error path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bf7717e1f84d180f42fb665772878d3b6d27459;p=mesa.git wsi/wayland: fix error path Fixes: 1720bbd353d87412754f ("anv/wsi: split image alloc/free out to separate fns.") Cc: "13.0" Signed-off-by: Eric Engestrom Signed-off-by: Dave Airlie --- diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 32a0a51349d..fc13bde4005 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -635,11 +635,15 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain, wl_display_roundtrip(chain->display->display); close(fd); + if (!image->buffer) + goto fail_image; + wl_proxy_set_queue((struct wl_proxy *)image->buffer, chain->queue); wl_buffer_add_listener(image->buffer, &buffer_listener, image); return VK_SUCCESS; +fail_image: chain->base.image_fns->free_wsi_image(vk_device, pAllocator, image->image, image->memory);