From: Leo Liu Date: Thu, 12 May 2016 14:05:57 +0000 (-0400) Subject: vl/dri: fix close fd error out X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd9ae724591d23d029ee9f8a2f200b60bf6fba2c;p=mesa.git 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 --- 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: