From 8bf7717e1f84d180f42fb665772878d3b6d27459 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Thu, 20 Oct 2016 00:09:11 +0100 Subject: [PATCH] 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 --- src/vulkan/wsi/wsi_common_wayland.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.30.2