[Mesa-dev] [PATCH 2/3] st/xa: don't call close(-1) in xa_tracker_create error path

Emil Velikov emil.l.velikov at gmail.com
Sat May 14 15:33:11 UTC 2016


Analogous to previous commit.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/state_trackers/xa/xa_tracker.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index f09baed..e091b083 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -152,7 +152,7 @@ xa_tracker_create(int drm_fd)
     struct xa_tracker *xa = calloc(1, sizeof(struct xa_tracker));
     enum xa_surface_type stype;
     unsigned int num_formats;
-    int fd = -1;
+    int fd;
 
     if (!xa)
 	return NULL;
@@ -212,9 +212,9 @@ xa_tracker_create(int drm_fd)
  out_no_screen:
     if (xa->dev)
 	pipe_loader_release(&xa->dev, 1);
-    fd = -1;
+    else
+	close(fd);
  out_no_fd:
-    close(fd);
     free(xa);
     return NULL;
 }
-- 
2.8.0



More information about the mesa-dev mailing list