[Mesa-dev] [PATCH] vl/dri: fix close fd error out

Leo Liu leo.liu at amd.com
Thu May 12 14:10:35 UTC 2016


fd should be set to -1 only if it got closed by pipe_loader_release.

Signed-off-by: Leo Liu <leo.liu at amd.com>
---
 src/gallium/auxiliary/vl/vl_winsys_dri.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c
index 0136526..4636feb 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -427,9 +427,10 @@ vl_dri2_screen_create(Display *display, int screen)
    return &scrn->base;
 
 release_pipe:
-   if (scrn->base.dev)
+   if (scrn->base.dev) {
       pipe_loader_release(&scrn->base.dev, 1);
-   fd = -1;
+      fd = -1;
+   }
 free_authenticate:
    free(authenticate);
 close_fd:
-- 
2.7.4



More information about the mesa-dev mailing list