vc4: Close our screen's fd on screen close.
authorEric Anholt <eric@anholt.net>
Mon, 11 Jul 2016 23:46:20 +0000 (16:46 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 12 Jul 2016 22:46:09 +0000 (15:46 -0700)
We're passed in a freshly dup()ed fd on screen create, so we should close
it on exit.  Debugged by Hugh Cole-Baker.

src/gallium/drivers/vc4/vc4_screen.c

index 0f0d119b1df5b0cd5f1e48ab264e975a60ec16d1..609dc91365595b0fdb0f12cf68159773197bfcec 100644 (file)
@@ -82,7 +82,10 @@ vc4_screen_get_vendor(struct pipe_screen *pscreen)
 static void
 vc4_screen_destroy(struct pipe_screen *pscreen)
 {
+        struct vc4_screen *screen = vc4_screen(pscreen);
+
         vc4_bufmgr_destroy(pscreen);
+        close(screen->fd);
         ralloc_free(pscreen);
 }