mirror of https://gitee.com/openkylin/linux.git
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:
parent
29fb52ca78
commit
57f50d70e2
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue