mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +02:00
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>
(cherry picked from commit 34d2637fa7)
This commit is contained in:
parent
4fa692872b
commit
7daa262486
2 changed files with 4 additions and 2 deletions
|
|
@ -31,7 +31,7 @@
|
|||
"description": "vulkan/wsi: Don't leak the FD when GetImageDrmFormatModifierProperties fails",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Reference in a new issue