render/vulkan: avoid double-close on sync_file FD after semaphore import

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3610
This commit is contained in:
Simon Ser 2023-03-16 10:39:50 +01:00
parent 12e28c3492
commit 59d2743c0c

View file

@ -840,8 +840,8 @@ static bool vulkan_sync_foreign_texture(struct wlr_vk_texture *texture) {
.fd = sync_file_fd,
};
res = renderer->dev->api.importSemaphoreFdKHR(renderer->dev->dev, &import_info);
close(sync_file_fd);
if (res != VK_SUCCESS) {
close(sync_file_fd);
wlr_vk_error("vkImportSemaphoreFdKHR", res);
return false;
}