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>
This commit is contained in:
Chris Wilson 2014-01-23 16:30:07 +00:00
parent e916c922ce
commit 6914b3af7f
1 changed files with 3 additions and 1 deletions

View File

@ -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) {