summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-03-14 08:32:15 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-03-14 08:32:42 +0000
commit3cc011ae11be6437241c3411bce1935ec0b187f5 (patch)
treef49b4685183d33d82b4f3a6edb8cd8e0ae2ba01b /src
parentba85e22c14ed243826d3edf35dd3813d23708d89 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display_fake.c3
1 files changed, 3 insertions, 0 deletions
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;