From: Jason Ekstrand Date: Mon, 2 Mar 2020 23:05:59 +0000 (-0600) Subject: vulkan/wsi: Don't leak the FD when GetImageDrmFormatModifierProperties fails X-Git-Tag: upstream/20.1.8~2560 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34d2637fa76ba4dd1969f06352e191ccb228d8f3;p=platform%2Fupstream%2Fmesa.git vulkan/wsi: Don't leak the FD when GetImageDrmFormatModifierProperties fails Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index 0adf54e..c278d5d 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -588,8 +588,10 @@ wsi_create_native_image(const struct wsi_swapchain *chain, result = wsi->GetImageDrmFormatModifierPropertiesEXT(chain->device, image->image, &image_mod_props); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS) { + close(fd); goto fail; + } image->drm_modifier = image_mod_props.drmFormatModifier; assert(image->drm_modifier != DRM_FORMAT_MOD_INVALID);