From: Eric Engestrom Date: Thu, 13 Sep 2018 19:36:15 +0000 (+0100) Subject: vulkan/wsi/display: check if wsi_swapchain_init() succeeded X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bde3102c0dc3e33d2605d013205e381ff6d93ace;p=mesa.git vulkan/wsi/display: check if wsi_swapchain_init() succeeded Fixes: da997ebec929421939553 "vulkan: Add KHR_display extension using DRM [v10]" Cc: Keith Packard Signed-off-by: Eric Engestrom Reviewed-by: Jason Ekstrand --- diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c index e99b0465ec9..3bf166977ea 100644 --- a/src/vulkan/wsi/wsi_common_display.c +++ b/src/vulkan/wsi/wsi_common_display.c @@ -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;