From bde3102c0dc3e33d2605d013205e381ff6d93ace Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Thu, 13 Sep 2018 20:36:15 +0100 Subject: [PATCH] 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 --- src/vulkan/wsi/wsi_common_display.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.30.2