From 3cc011ae11be6437241c3411bce1935ec0b187f5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 14 Mar 2016 08:32:15 +0000 Subject: sna: Avoid double-skipping when deleting arrays of CRTCs When we call xf86CrtcDestroy/xf86OutputDestroy the arrays are shrunk and the next pointer is then at the current location, so we need to take a step back when iterating over the entire array. Signed-off-by: Chris Wilson --- src/sna/sna_display_fake.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sna/sna_display_fake.c') diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c index 7468326d..f0bdea63 100644 --- a/src/sna/sna_display_fake.c +++ b/src/sna/sna_display_fake.c @@ -314,13 +314,16 @@ err: continue; xf86OutputDestroy(output); + i--; } for (i = 0; i < xf86_config->num_crtc; i++) { crtc = xf86_config->crtc[i]; if (crtc->driver_private) continue; + xf86CrtcDestroy(crtc); + i--; } sna->mode.num_fake = -1; return false; -- cgit v1.2.3