public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_3d: fix uninitialized value
@ 2019-08-29 10:37 Simon Ser
  2019-08-29 11:03 ` Petri Latvala
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Ser @ 2019-08-29 10:37 UTC (permalink / raw)
  To: igt-dev

If the device doesn't have any HDMI connectors, garbage is read from the stack.

Signed-off-by: Simon Ser <simon.ser@intel.com>
---
 tests/kms_3d.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/kms_3d.c b/tests/kms_3d.c
index b970b3b5521c..2622b2d0a6f3 100644
--- a/tests/kms_3d.c
+++ b/tests/kms_3d.c
@@ -30,7 +30,7 @@ igt_simple_main
 {
 	int drm_fd;
 	drmModeRes *res;
-	drmModeConnector *connector;
+	drmModeConnector *connector = NULL;
 	const struct edid *edid;
 	int mode_count, connector_id;

@@ -43,14 +43,10 @@ igt_simple_main

 	/* find an hdmi connector */
 	for (int i = 0; i < res->count_connectors; i++) {
-
 		connector = drmModeGetConnectorCurrent(drm_fd, res->connectors[i]);
-
 		if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA)
 			break;
-
 		drmModeFreeConnector(connector);
-
 		connector = NULL;
 	}
 	igt_require(connector);
--
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-08-30  1:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-29 10:37 [igt-dev] [PATCH i-g-t] tests/kms_3d: fix uninitialized value Simon Ser
2019-08-29 11:03 ` Petri Latvala
2019-08-29 12:34 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-30  1:25 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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