diff options
author | Dave Airlie <airlied@redhat.com> | 2013-10-29 12:09:26 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-11-14 16:35:20 +0900 |
commit | d1440783a7367ff0d0c47d256bbca3b3cf8a5034 (patch) | |
tree | 433abcdc164eadd235f3840e795780c64df87fb9 | |
parent | d7ee27e5e415778240919082c83a65226c6f17e6 (diff) |
xfree86: return NULL for compat output if no outputs.
With outputless GPUs showing up we crash here if there are not outputs
try and recover with a bit of grace.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 2a02c8507..a441fd16a 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1863,6 +1863,9 @@ SetCompatOutput(xf86CrtcConfigPtr config) DisplayModePtr maxmode = NULL, testmode, mode; int o, compat = -1, count, mincount = 0; + if (config->num_output == 0) + return NULL; + /* Look for one that's definitely connected */ for (o = 0; o < config->num_output; o++) { test = config->output[o]; |