[Intel-gfx] [PATCH 2/5] lib: Close non intel fds in drm_get_card()

Damien Lespiau damien.lespiau at intel.com
Thu Oct 24 16:40:53 CEST 2013


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.lespiau at 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




More information about the Intel-gfx mailing list