summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-06-02 10:44:29 +0100
committerAlan Hourihane <alanh@tungstengraphics.com>2008-06-02 10:44:29 +0100
commit3ed17803d826b10f8f94d09acf12877e9738823c (patch)
treec25b3ad4bcca87e47eaa4cd917824c17cc72fa90 /linux-core
parentdc022084cda0a5558f033c3caa657d5af84ef544 (diff)
more checks for NULL encoder so we don't segfault.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drm_crtc_helper.c9
-rw-r--r--linux-core/intel_display.c3
-rw-r--r--linux-core/intel_fb.c3
3 files changed, 12 insertions, 3 deletions
diff --git a/linux-core/drm_crtc_helper.c b/linux-core/drm_crtc_helper.c
index a8c44b76..fcb1243c 100644
--- a/linux-core/drm_crtc_helper.c
+++ b/linux-core/drm_crtc_helper.c
@@ -662,7 +662,14 @@ bool drm_helper_initial_config(struct drm_device *dev, bool can_grow)
*/
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;
diff --git a/linux-core/intel_display.c b/linux-core/intel_display.c
index ba9441d6..8a8f4edb 100644
--- a/linux-core/intel_display.c
+++ b/linux-core/intel_display.c
@@ -228,7 +228,8 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
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;
diff --git a/linux-core/intel_fb.c b/linux-core/intel_fb.c
index 268e95c5..d490880a 100644
--- a/linux-core/intel_fb.c
+++ b/linux-core/intel_fb.c
@@ -277,7 +277,8 @@ static int intelfb_set_par(struct fb_info *info)
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;
}