summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-23 16:30:07 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-23 17:38:27 +0000
commit6914b3af7f26c7b61e4ee6ea3a6ccda5011fa4da (patch)
tree987004a9068330f0173c6854d3aff9eff3535ad6
parente916c922ce3913712cd8a9b76ab037840b7f07f1 (diff)
sna: Protect against fake CRTCs during initial probe
Reported-by: Nick Bowler <nbowler@draconx.ca> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73981 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 30a01330..c28f558c 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3492,7 +3492,9 @@ static bool sna_probe_initial_configuration(struct sna *sna)
for (j = 0; j < config->num_crtc; j++) {
xf86CrtcPtr crtc = config->crtc[j];
- if (to_sna_crtc(crtc)->id != crtc_id)
+
+ if (to_sna_crtc(crtc) == NULL ||
+ to_sna_crtc(crtc)->id != crtc_id)
continue;
if (crtc->desiredMode.status == MODE_OK) {