sna: Sanitize output->crtc before falling back oto xf86InitialConfiguration
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Oct 2013 15:22:45 +0000 (16:22 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Oct 2013 15:27:22 +0000 (16:27 +0100)
commitf0bd716425d1514b62565f9a65397cd1cb2ffb3a
treeb519ccb62bb77f121b64f7efcd37a6915142b359
parent700a845cc611f3e499cf0ff01bd99d472d6fd7ac
sna: Sanitize output->crtc before falling back oto xf86InitialConfiguration

During initialisation, we stash the currently attached CRTC id in
output->crtc. This is fine as ordinarily we would not dereference
output->crtc until after it had been assigned a real CRTC. However,

commit 6fda305e2f2f991b39d09e67d0b17c8c3d50f9a4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 9 15:59:42 2013 +0100

    sna: Append the current mode to the output list if not found

introduces such an early dereference and causes a crash if we fail to
probe the KMS configuration (usually due to a user override).

Reported-by: Łukasz Maśko <ed@yen.ipipan.waw.pl>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_display.c