summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-12-03 08:58:39 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2018-12-03 09:01:25 +0000
commite5ff8e1828f97891c819c919d7115c6e18b2eb1f (patch)
tree023c46d778ce47621dfaa5fe3b5aa5330c2f8c4f /src
parent746ab3bb131dea8ad015e7804bfcdd6b4cc4f44e (diff)
sna: Skip restoring a mode for link-status=bad if the crtc was idle
If we do not have a mode (and bo) enabled on the crtc, then trying to restore that bo ends up in a NULL pointer dereference. Reported-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 307d5344..f6a6d99b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5470,6 +5470,9 @@ output_retrain_link(struct sna *sna, struct sna_output *output)
int crtc_x = crtc->offset & 0xffff;
int crtc_y = crtc->offset >> 16;
+ if (!crtc->bo)
+ return false;
+
return sna_crtc_flip(sna, crtc, crtc->bo, crtc_x, crtc_y);
}