[Intel-gfx] [PATCH i-g-t 1/3] igt_kms: Fix use after free in kmstest_get_pipe_from_crtc_id

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Apr 27 15:12:34 UTC 2016


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 lib/igt_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index ef24a4965567..7557bdc20fa4 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -402,10 +402,10 @@ int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id)
 			break;
 	}
 
-	drmModeFreeResources(res);
-
 	igt_assert(i < res->count_crtcs);
 
+	drmModeFreeResources(res);
+
 	return i;
 }
 
-- 
1.9.1



More information about the Intel-gfx mailing list