*/
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
- struct drm_crtc *crtc = connector->encoder->crtc;
+ struct drm_encoder *encoder = connector->encoder;
+ struct drm_crtc *crtc;
+
+ if (!encoder)
+ continue;
+
+ crtc = connector->encoder->crtc;
+
/* can't setup the connector if there's no assigned mode */
if (!crtc || !crtc->desired_mode)
continue;
struct drm_connector *l_entry;
list_for_each_entry(l_entry, &mode_config->connector_list, head) {
- if (l_entry->encoder->crtc == crtc) {
+ if (l_entry->encoder &&
+ l_entry->encoder->crtc == crtc) {
struct intel_output *intel_output = to_intel_output(l_entry);
if (intel_output->type == type)
return true;
found = 0;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
- if (connector->encoder->crtc == par->set.crtc){
+ if (connector->encoder &&
+ connector->encoder->crtc == par->set.crtc){
found = 1;
break;
}