summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Müller <serveralex@gmail.com>2011-12-30 12:55:48 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-06 14:17:33 -0800
commite5697e5158f562e3e7130e2880a5d0abea6cd4cd (patch)
tree8f050a15a59a49f5e6447e0bd047b22ce6cca52d
parentb7ef0c519dd78c3bbd2e9903675c2ec16e38831e (diff)
downloadlinux-stable-e5697e5158f562e3e7130e2880a5d0abea6cd4cd.tar.gz
linux-stable-e5697e5158f562e3e7130e2880a5d0abea6cd4cd.tar.bz2
linux-stable-e5697e5158f562e3e7130e2880a5d0abea6cd4cd.zip
drm/radeon/kms/atom: fix possible segfault in pm setup
commit 4376eee92e5a8332b470040e672ea99cd44c826a upstream. If we end up with no power states, don't look up current vddc. fixes: https://bugs.freedesktop.org/show_bug.cgi?id=44130 agd5f: fix patch formatting Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 285acc4f1e1d..a098edcf6628 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -2568,7 +2568,11 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
rdev->pm.current_power_state_index = rdev->pm.default_power_state_index;
rdev->pm.current_clock_mode_index = 0;
- rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
+ if (rdev->pm.default_power_state_index >= 0)
+ rdev->pm.current_vddc =
+ rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
+ else
+ rdev->pm.current_vddc = 0;
}
void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable)