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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user