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>
This commit is contained in:
Alex Deucher 2010-03-14 16:31:36 -04:00 committed by Dave Airlie
parent 29fb52ca78
commit 57f50d70e2
1 changed files with 2 additions and 1 deletions

View File

@ -279,7 +279,8 @@ void radeon_pm_compute_clocks(struct radeon_device *rdev)
list_for_each_entry(connector, list_for_each_entry(connector,
&ddev->mode_config.connector_list, head) { &ddev->mode_config.connector_list, head) {
if (connector->encoder && 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); radeon_crtc = to_radeon_crtc(connector->encoder->crtc);
rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id); rdev->pm.active_crtcs |= (1 << radeon_crtc->crtc_id);
++count; ++count;