vulkan/wsi: Don't leak the FD when GetImageDrmFormatModifierProperties fails
Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4135>
This commit is contained in:
parent
3c96e25de7
commit
34d2637fa7
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue