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

Emil Velikov evelikov at kemper.freedesktop.org
Mon Oct 24 11:24:42 UTC 2016


Module: Mesa
Branch: 13.0
Commit: 4768b7353ff47eb6d80093b0c6f5e35747365411
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4768b7353ff47eb6d80093b0c6f5e35747365411

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>
(cherry picked from commit 8bf7717e1f84d180f42fb665772878d3b6d27459)

---

 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