summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2016-05-12 10:05:57 -0400
committerLeo Liu <[email protected]>2016-05-12 18:26:48 -0400
commitbd9ae724591d23d029ee9f8a2f200b60bf6fba2c (patch)
tree8b640af37be31f39e970e51c90432e81b8680452 /src/gallium
parent988b09f9ac6cde0caa2e0db91c1367c90f0f4c2a (diff)
vl/dri: fix close fd error out
fd should be set to -1 only if it got closed by pipe_loader_release. Signed-off-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/vl/vl_winsys_dri.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c
index 01365260312..9ecc216b9c5 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -427,13 +427,15 @@ 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:
- close(fd);
+ if (fd != -1)
+ close(fd);
free_connect:
free(connect);
free_query: