From 8329acb752721ad93dab70624b136f1befd4be3f Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 24 Oct 2013 15:04:26 +0100 Subject: [PATCH] lib: Close non intel fds in drm_get_card() 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 --- 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; -- 2.7.4