When going through card%u devices, close the ones that we were able to
open but weren't intel devices.

Signed-off-by: Damien Lespiau <damien.lesp...@intel.com>
---
 lib/drmtest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index b94981e..3b80920 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -187,8 +187,10 @@ int drm_get_card(void)
                if (fd == -1)
                        continue;
 
-               if (!is_intel(fd))
+               if (!is_intel(fd)) {
+                       close(fd);
                        continue;
+               }
 
                close(fd);
                return i;
-- 
1.8.3.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to