From: Eric Engestrom Date: Tue, 10 Mar 2020 17:54:41 +0000 (+0100) Subject: vulkan/wsi: fix cleanup when dup() fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1fa259b035c000b590a91a5b51412a2ff1972ab0;p=mesa.git vulkan/wsi: fix cleanup when dup() fails Fixes: f5433e4d6ce247b86dae ("vulkan/wsi: Add modifiers support to wsi_create_native_image") Signed-off-by: Eric Engestrom Reviewed-by: Jason Ekstrand Tested-by: Marge Bot Part-of: --- diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index 8d6654cb47d..d629ea339ac 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -620,7 +620,7 @@ wsi_create_native_image(const struct wsi_swapchain *chain, image->fds[p] = dup(fd); if (image->fds[p] == -1) { for (uint32_t i = 0; i < p; i++) - close(image->fds[p]); + close(image->fds[i]); result = VK_ERROR_OUT_OF_HOST_MEMORY; goto fail;