[igt-dev] [PATCH i-g-t v4 14/77] i915/gem_userptr_blits: Close device before exit

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Wed Oct 5 07:44:43 UTC 2022


From: Chris Wilson <chris.p.wilson at intel.com>

Close the device fd before we check for leaks during the atexit
handlers.

Signed-off-by: Chris Wilson <chris.p.wilson at intel.com>
Acked-by: Andrzej Hajda <andrzej.hajda at intel.com>
Reviewed-by: Nirmoy Das<nirmoy.das at intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 tests/i915/gem_userptr_blits.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index 1343b1097aef..6985086694c4 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -62,6 +62,7 @@
 #include "i915/gem_create.h"
 #include "igt.h"
 #include "igt_sysfs.h"
+#include "igt_types.h"
 #include "sw_sync.h"
 
 #include "eviction_common.c"
@@ -2299,7 +2300,7 @@ static void test_userfault(int i915)
 
 uint64_t total_ram;
 uint64_t aperture_size;
-int fd, count;
+int count;
 
 static int opt_handler(int opt, int opt_index, void *data)
 {
@@ -2319,6 +2320,7 @@ const char *help_str = "  -c\tBuffer count\n";
 igt_main_args("c:", NULL, help_str, opt_handler, NULL)
 {
 	int size = sizeof(linear);
+	igt_fd_t(fd);
 
 	igt_fixture {
 		unsigned int mmo_max = 0;
-- 
2.37.3



More information about the igt-dev mailing list