wsi/wayland: only finish() a successfully init()ed display
authorEric Engestrom <eric.engestrom@intel.com>
Mon, 5 Nov 2018 09:57:09 +0000 (09:57 +0000)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 5 Nov 2018 15:29:21 +0000 (15:29 +0000)
Fixes: 43691024982b3ea734ad0 "vulkan/wsi/wayland: Stop caching Wayland displays"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
src/vulkan/wsi/wsi_common_wayland.c

index 12014b0c143d93df96dd08cc2c083313b1015b04..3d3a60167bfa7a6ba699c242a0f69795b51f7438 100644 (file)
@@ -456,7 +456,8 @@ wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
 
    struct wsi_wl_display display;
    VkResult ret = wsi_wl_display_init(wsi, &display, wl_display, false);
-   wsi_wl_display_finish(&display);
+   if (ret == VK_SUCCESS)
+      wsi_wl_display_finish(&display);
 
    return ret == VK_SUCCESS;
 }