summary refs log tree commit diff stats
path: root/hw/display/vhost-user-gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/display/vhost-user-gpu.c')
-rw-r--r--hw/display/vhost-user-gpu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 709c8a02a1..454e5afcff 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -262,10 +262,7 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUserGpuMsg *msg)
         g->parent_obj.enable = 1;
         con = g->parent_obj.scanout[m->scanout_id].con;
         dmabuf = &g->dmabuf[m->scanout_id];
-        if (dmabuf->fd >= 0) {
-            close(dmabuf->fd);
-            dmabuf->fd = -1;
-        }
+        qemu_dmabuf_close(dmabuf);
         dpy_gl_release_dmabuf(con, dmabuf);
         if (fd == -1) {
             dpy_gl_scanout_disable(con);