[PATCH i-g-t 3/3] lib/igt_kms: Fix cleanup in igt_display_reset_outputs()

Kamil Konieczny
2026-04-24T15:14:42Z

After free of outputs, set their number to zero so in case of
unlikly event when drm resources become unavailable, returned
structure will retain correct info.

Cc: Mark Yacoub <markyacoub@chromium.org>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
lib/igt_kms.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 33092fc85..51c3392fc 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2913,6 +2913,7 @@ void igt_display_reset_outputs(igt_display_t *display)
free(config->connector_path);
}
free(display->outputs);
+ display->n_outputs = 0;
}

resources = drmModeGetResources(display->drm_fd);
--
2.54.0