vulkan/wsi/display: check if wsi_swapchain_init() succeeded
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 13 Sep 2018 19:36:15 +0000 (20:36 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 24 Sep 2018 16:37:43 +0000 (17:37 +0100)
Fixes: da997ebec929421939553 "vulkan: Add KHR_display extension using DRM [v10]"
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/vulkan/wsi/wsi_common_display.c

index e99b0465ec9b6757d5d2cc3e633e7a1a6db84e24..3bf166977eaa11e979493695599e094bcc6f1be9 100644 (file)
@@ -1712,6 +1712,10 @@ wsi_display_surface_create_swapchain(
 
    VkResult result = wsi_swapchain_init(wsi_device, &chain->base, device,
                                         create_info, allocator);
+   if (result != VK_SUCCESS) {
+      vk_free(allocator, chain);
+      return result;
+   }
 
    chain->base.destroy = wsi_display_swapchain_destroy;
    chain->base.get_wsi_image = wsi_display_get_wsi_image;