[igt-dev] [PATCH v2 73/77] feature_discovery: Close device before exit

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Mon Sep 5 05:53:47 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>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl at intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---

To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH v2 00/77] at: https://lore.kernel.org/all/cover.1662357022.git.mchehab@kernel.org/

 tests/feature_discovery.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/feature_discovery.c b/tests/feature_discovery.c
index 1978ce890de2..d369812ae614 100644
--- a/tests/feature_discovery.c
+++ b/tests/feature_discovery.c
@@ -29,15 +29,16 @@
 #include "igt_kms.h"
 #include "igt_psr.h"
 #include "igt_sysfs.h"
+#include "igt_types.h"
 
-static int fd;
-static int debugfs_fd;
 static igt_display_t display;
 
 IGT_TEST_DESCRIPTION("A metatest that checks for \"features\" presence. "
 		     "The subtests here should only skip or pass, "
 		     "anything else means we have a serious problem.");
 igt_main {
+	igt_fd_t(debugfs_fd);
+	igt_fd_t(fd);
 
 	igt_fixture {
 		fd = drm_open_driver_master(DRIVER_ANY);
-- 
2.37.2



More information about the igt-dev mailing list