[Mesa-dev] [PATCH mesa v2] vulkan/wsi/display: check if wsi_swapchain_init() succeeded

Jason Ekstrand jason at jlekstrand.net
Fri Sep 14 12:48:37 UTC 2018


Rb

On September 14, 2018 04:12:44 Eric Engestrom <eric.engestrom at intel.com> wrote:

> Fixes: da997ebec929421939553 "vulkan: Add KHR_display extension using DRM 
> [v10]"
> Cc: Keith Packard <keithp at keithp.com>
> Cc: Jason Ekstrand <jason at jlekstrand.net>
> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> ---
> v2: don't forget to free the swapchain too (Jason)
> ---
> 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 1e90bba460cba190c5ab..338fad6be792385db9f4 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;
> --
> Cheers,
>  Eric





More information about the mesa-dev mailing list