Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [i-g-t] tests/intel/i915_suspend: Fix WARNs of invalid fd
@ 2024-01-09 13:18 Bhanuprakash Modem
  2024-01-09 15:53 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Bhanuprakash Modem @ 2024-01-09 13:18 UTC (permalink / raw)
  To: igt-dev

Call drm_close_driver() only if fd >=0, otherwise it'll 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@intel.com>
---
 tests/intel/i915_suspend.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/intel/i915_suspend.c b/tests/intel/i915_suspend.c
index c25805584..82cabfa41 100644
--- a/tests/intel/i915_suspend.c
+++ b/tests/intel/i915_suspend.c
@@ -300,7 +300,9 @@ test_suspend_without_i915(int state)
 		igt_pm_get_d3cold_allowed(card.pci_slot_name, &d3cold_allowed);
 		igt_pm_set_d3cold_allowed(card.pci_slot_name, 0);
 	}
-	drm_close_driver(fd);
+
+	if (fd >= 0)
+		drm_close_driver(fd);
 
 	igt_kmsg(KMSG_INFO "Unloading i915\n");
 	igt_assert_eq(igt_i915_driver_unload(),0);
-- 
2.40.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-24 12:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 13:18 [i-g-t] tests/intel/i915_suspend: Fix WARNs of invalid fd Bhanuprakash Modem
2024-01-09 15:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-01-09 17:15 ` ✓ CI.xeBAT: " Patchwork
2024-01-09 18:00 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-17 11:12 ` [i-g-t] " Kamil Konieczny
2024-01-17 15:22   ` Modem, Bhanuprakash
2024-01-17 18:51     ` Kamil Konieczny
2024-01-18  4:44     ` Gupta, Anshuman
2024-01-19 13:32       ` Kamil Konieczny
2024-01-24  8:16         ` Modem, Bhanuprakash
2024-01-24 12:45           ` Kamil Konieczny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox