aboutsummaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi/wsi_common.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-03-02 17:05:59 -0600
committerMarge Bot <[email protected]>2020-03-10 16:39:27 +0000
commit34d2637fa76ba4dd1969f06352e191ccb228d8f3 (patch)
treecaa3b4b7a068e3a7844b8ac64dc7fec6a4939fa1 /src/vulkan/wsi/wsi_common.c
parent3c96e25de77b4879f54ef5727378dacf13e7e398 (diff)
vulkan/wsi: Don't leak the FD when GetImageDrmFormatModifierProperties fails
Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4135>
Diffstat (limited to 'src/vulkan/wsi/wsi_common.c')
-rw-r--r--src/vulkan/wsi/wsi_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 0adf54eab8f..c278d5d1347 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);