aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied2.(none)>2007-04-18 10:41:39 +1000
committerDave Airlie <airlied@airlied2.(none)>2007-04-18 10:41:39 +1000
commitd20aaf485893ed11dd0d68daf63ccadd77b02213 (patch)
treedfa5b818cad127c8157244d463d3dbfe1899b6f0
parent2352ec9bfab20761cc898ea40db2a7c6d53e81f3 (diff)
don't crash if no desired mode
-rw-r--r--linux-core/drm_crtc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c
index 0fb5b9ae..437259d5 100644
--- a/linux-core/drm_crtc.c
+++ b/linux-core/drm_crtc.c
@@ -572,7 +572,7 @@ bool drm_initial_config(drm_device_t *dev, bool can_grow)
/* bind analog output to one crtc */
list_for_each_entry(output, &dev->mode_config.output_list, head) {
- struct drm_display_mode *des_mode;
+ struct drm_display_mode *des_mode = NULL;
if (list_empty(&output->modes))
continue;
@@ -582,6 +582,10 @@ bool drm_initial_config(drm_device_t *dev, bool can_grow)
if (des_mode->flags & DRM_MODE_TYPE_PREFERRED)
break;
}
+
+ if (!des_mode)
+ continue;
+
if (!strncmp(output->name, "VGA", 3)) {
DRM_DEBUG("VGA preferred mode: %s\n", des_mode->name);
drm_setup_output(output, vga_crtc, des_mode);