From ef178f7d6955e12383c64ad9ee706db0e931992e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 5 May 2014 09:37:56 +0100 Subject: [PATCH] sna: Fix loop iteration whilst deleting connectors If we remove a connector/output, we need to not advance the iterator or else we skip over an output (as the array is reduces inside the loop). Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index e46f5d15..6a1d0226 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -2964,7 +2964,7 @@ void sna_mode_discover(struct sna *sna) for (i = 0; i < sna->mode.num_real_output; i++) { xf86OutputPtr output = config->output[i]; if (to_sna_output(output)->serial != serial) { - sna_output_del(output); + sna_output_del(output); i--; changed = true; } }