aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-03-14 16:31:36 -0400
committerDave Airlie <airlied@redhat.com>2010-03-30 19:53:46 -0400
commit57f50d70e27f99a9a785c760b2123cdf6a68e2de (patch)
tree3b5be46b2294c254b7db4e178274a62eabc2f998 /drivers/gpu/drm
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/gpu/drm')
-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 6458d52be4ee..a4b57493aa78 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)
279 list_for_each_entry(connector, 279 list_for_each_entry(connector,
280 &ddev->mode_config.connector_list, head) { 280 &ddev->mode_config.connector_list, head) {
281 if (connector->encoder && 281 if (connector->encoder &&
282 connector->dpms != DRM_MODE_DPMS_OFF) { 282 connector->encoder->crtc &&
283 connector->dpms != DRM_MODE_DPMS_OFF) {
283 radeon_crtc = to_radeon_crtc(connector->encoder->crtc); 284 radeon_crtc = to_radeon_crtc(connector->encoder->crtc);
284 rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id); 285 rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id);
285 ++count; 286 ++count;