summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2016-10-20 00:09:11 +0100
committerDave Airlie <airlied@redhat.com>2016-10-20 10:53:59 +1000
commit8bf7717e1f84d180f42fb665772878d3b6d27459 (patch)
tree911826b0b75eeb7e8ce414255b395e9730f5c15e
parentb0f131b0bf1d3f4eb5943d5485bbed170844c727 (diff)
wsi/wayland: fix error path
Fixes: 1720bbd353d87412754f ("anv/wsi: split image alloc/free out to separate fns.") Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Eric Engestrom <eric@engestrom.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c4
1 files changed, 4 insertions, 0 deletions
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);