From: Dave Airlie Date: Wed, 4 Jun 2008 05:17:13 +0000 (+1000) Subject: drm: fix hotplug oops X-Git-Tag: submit/1.0/20121108.012404~642^2~155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf1964f971cc298ece91064953f7d00ed13e541d;p=profile%2Fivi%2Flibdrm.git drm: fix hotplug oops --- diff --git a/linux-core/drm_crtc_helper.c b/linux-core/drm_crtc_helper.c index 58d21b9..4083d6b 100644 --- a/linux-core/drm_crtc_helper.c +++ b/linux-core/drm_crtc_helper.c @@ -712,9 +712,11 @@ int drm_helper_hotplug_stage_two(struct drm_device *dev, struct drm_connector *c return 0; } - if (connector->encoder->crtc && connector->encoder->crtc->desired_mode) { - DRM_DEBUG("drm thinks that the connector already has a config\n"); - has_config = 1; + if (connector->encoder) { + if (connector->encoder->crtc && connector->encoder->crtc->desired_mode) { + DRM_DEBUG("drm thinks that the connector already has a config\n"); + has_config = 1; + } } drm_helper_probe_connector_modes(dev, 2048, 2048); @@ -722,6 +724,11 @@ int drm_helper_hotplug_stage_two(struct drm_device *dev, struct drm_connector *c if (!has_config) drm_pick_crtcs(dev); + if (!connector->encoder) { + DRM_DEBUG("could not find a desired mode or crtc for connector\n"); + return 1; + } + if (!connector->encoder->crtc || !connector->encoder->crtc->desired_mode) { DRM_DEBUG("could not find a desired mode or crtc for connector\n"); return 1;