vulkan/wsi/display: check if wsi_swapchain_init() succeeded

Fixes: da997ebec9 "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>
This commit is contained in:
Eric Engestrom 2018-09-13 20:36:15 +01:00
parent 3e7b5e5db2
commit bde3102c0d

View 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;