virgl: Close handle on resource info failure

We just opened the GEM handle a few line before (or used drmPrimeFDToHandle to
acquire it), on failure it is just better to close it.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34437>
This commit is contained in:
Corentin Noël
2025-04-09 18:19:58 +02:00
committed by Marge Bot
parent 60d815d1bf
commit 5144a4f56c
@@ -560,6 +560,8 @@ virgl_drm_winsys_resource_create_handle(struct virgl_winsys *qws,
info_arg.bo_handle = res->bo_handle;
if (drmIoctl(qdws->fd, DRM_IOCTL_VIRTGPU_RESOURCE_INFO, &info_arg)) {
drmCloseBufferHandle(qdws->fd, res->bo_handle);
/* close */
FREE(res);
res = NULL;