summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-02-11 17:39:21 +0100
committerDave Airlie <airlied@redhat.com>2009-02-20 03:21:12 +0100
commite62fb64e6187ea9d8bcedb17ccaa045ed92d4b55 (patch)
treed2f7e85ed1ce8afd4e36dd2bfe10f9620756ec8e /drivers/gpu/drm
parentdrm/i915: Cleanup the hws on ringbuffer constrution failure. (diff)
downloadlinux-e62fb64e6187ea9d8bcedb17ccaa045ed92d4b55.tar.xz
linux-e62fb64e6187ea9d8bcedb17ccaa045ed92d4b55.zip
drm: Check for a NULL encoder when reverting on error path
We need to skip the connectors with a NULL encoder to match the success path and avoid an OOPS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 964c5eb1fada..8ba22c039a11 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -775,8 +775,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fail_set_mode:
set->crtc->enabled = save_enabled;
count = 0;
- list_for_each_entry(connector, &dev->mode_config.connector_list, head)
+ list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+ if (!connector->encoder)
+ continue;
+
connector->encoder->crtc = save_crtcs[count++];
+ }
fail_no_encoder:
kfree(save_crtcs);
count = 0;