From: Alex Deucher Date: Sun, 14 Mar 2010 20:31:36 +0000 (-0400) Subject: drm/radeon/kms/pm: fix segfault in clock code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=57f50d70e27f99a9a785c760b2123cdf6a68e2de;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.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 --- 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) 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;