aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-03-14 16:31:36 -0400
committerDave Airlie <airlied@redhat.com>2010-03-31 09:53:46 +1000
commit57f50d70e27f99a9a785c760b2123cdf6a68e2de (patch)
tree3b5be46b2294c254b7db4e178274a62eabc2f998 /drivers
parent29fb52ca78b4e265ec6c626b0c7b2927953949cf (diff)
drm/radeon/kms/pm: fix segfault in clock code
Make sure we have a crtc assigned to the encoder before dereferencing it. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 6458d52be4e..a4b57493aa7 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -279,7 +279,8 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
list_for_each_entry(connector,
&ddev->mode_config.connector_list, head) {
if (connector->encoder &&
- connector->dpms != DRM_MODE_DPMS_OFF) {
+ connector->encoder->crtc &&
+ connector->dpms != DRM_MODE_DPMS_OFF) {
radeon_crtc = to_radeon_crtc(connector->encoder->crtc);
rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id);
++count;