[i-g-t V2] tests/intel/i915_suspend: Fix WARN of invalid fd

Bhanuprakash Modem bhanuprakash.modem at intel.com
Tue Jan 9 13:10:46 UTC 2024


Skip if fd < 0, else drm_close_driver() will throw WARN:

(i915_suspend:7563) drmtest-WARNING: Don't attempt to close standard/invalid file descriptor: -1

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/intel/i915_suspend.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/intel/i915_suspend.c b/tests/intel/i915_suspend.c
index c25805584..0d216741d 100644
--- a/tests/intel/i915_suspend.c
+++ b/tests/intel/i915_suspend.c
@@ -287,6 +287,7 @@ test_suspend_without_i915(int state)
 	int fd;
 
 	fd = __drm_open_driver(DRIVER_INTEL);
+	igt_skip_on_f(fd < 0, "No known gpu found.\n");
 	igt_devices_scan(false);
 
 	/*
-- 
2.40.0



More information about the igt-dev mailing list