Mesa (master): wsi/wayland: fix error path

Dave Airlie airlied at kemper.freedesktop.org
Thu Oct 20 00:54:10 UTC 2016


Module: Mesa
Branch: master
Commit: 8bf7717e1f84d180f42fb665772878d3b6d27459
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8bf7717e1f84d180f42fb665772878d3b6d27459

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Thu Oct 20 00:09:11 2016 +0100

wsi/wayland: fix error path

Fixes: 1720bbd353d87412754f ("anv/wsi: split image alloc/free out to separate fns.")
Cc: "13.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 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 32a0a51..fc13bde 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);
 




More information about the mesa-commit mailing list