virgl: close drm fd when destroying virgl screen.
authorLepton Wu <lepton@chromium.org>
Mon, 18 Mar 2019 23:40:25 +0000 (16:40 -0700)
committerGurchetan Singh <gurchetansingh@chromium.org>
Tue, 2 Apr 2019 22:29:47 +0000 (15:29 -0700)
This fd was create in virgl_drm_screen_create and should be closed
in virgl_drm_screen_destroy.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c

index 120e8eda2cdb0590e8dc7b28805866be3f517512..2cf8b4ba076d00637f10df8e7c3fbedabe7fd760 100644 (file)
@@ -972,6 +972,7 @@ virgl_drm_screen_destroy(struct pipe_screen *pscreen)
    if (destroy) {
       int fd = virgl_drm_winsys(screen->vws)->fd;
       util_hash_table_remove(fd_tab, intptr_to_pointer(fd));
+      close(fd);
    }
    mtx_unlock(&virgl_screen_mutex);