drm/radeon/kms/pm: fix segfault in clock code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, April 1, 2010 - 10:59 am

Gitweb:     http://git.kernel.org/linus/57f50d70e27f99a9a785c760b2123cdf6a68e2de
Commit:     57f50d70e27f99a9a785c760b2123cdf6a68e2de
Parent:     29fb52ca78b4e265ec6c626b0c7b2927953949cf
Author:     Alex Deucher <alexdeucher@gmail.com>
AuthorDate: Sun Mar 14 16:31:36 2010 -0400
Committer:  Dave Airlie <airlied@redhat.com>
CommitDate: Wed Mar 31 09:53:46 2010 +1000

    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>
---
 drivers/gpu/drm/radeon/radeon_pm.c |    3 ++-
 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 6458d52..a4b5749 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;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drm/radeon/kms/pm: fix segfault in clock code, Linux Kernel Mailing ..., (Thu Apr 1, 10:59 am)