summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorcheyang <cheyang@bytedance.com>2021-05-26 20:44:57 +0800
committerMarge Bot <eric+marge@anholt.net>2021-05-27 04:30:13 +0000
commit4a3c715bb4654ae2c8b61bfb8af8dadde60d675a (patch)
treef61ff68652e58a3ee13368143523c62b30e63520 /src/gallium/winsys
parentb8d59e68beb27b1308d726c2e515b23e87e47f79 (diff)
virgl:Fix the leak of hw_res used as fence
Fence destroy hw_res not dec reference.Lead leak. Call virgl_drm_resource_reference() to release hw_res instead of calling virgl_hw_res_destroy() directly. Fixes: c54fb6ef3d8 ("virgl: Don't destroy resource while it's in use.") Signed-off-by: cheyang <cheyang@bytedance.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Lepton Wu <lepton@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11008>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 6ff94ced519..1dd7b001925 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -1044,8 +1044,7 @@ static void virgl_fence_reference(struct virgl_winsys *vws,
if (vws->supports_fences) {
close(dfence->fd);
} else {
- struct virgl_drm_winsys *vdws = virgl_drm_winsys(vws);
- virgl_hw_res_destroy(vdws, dfence->hw_res);
+ virgl_drm_resource_reference(vws, &dfence->hw_res, NULL);
}
FREE(dfence);
}