aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-01-07 21:40:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-13 16:48:02 -0500
commitdd6eab0527ac15c07d79c8f81fbb3085eb8e282a (patch)
tree8047cac6cc1cdde7e265de5c04c3fb3d212dee4d
parent06dd2b2c5d81c8a6c13c5a731f2ca73a7d7f07ff (diff)
radeon/pm: Guard access to rdev->pm.power_state array
commit 370169516e736edad3b3c5aa49858058f8b55195 upstream. It's never allocated on systems without an ATOMBIOS or COMBIOS ROM. Should fix an oops I encountered while resetting the GPU after a lockup on my PowerBook with an RV350. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 788c64cb4b47..469ba710b52f 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -561,8 +561,10 @@ void radeon_pm_resume(struct radeon_device *rdev)
561 rdev->pm.current_clock_mode_index = 0; 561 rdev->pm.current_clock_mode_index = 0;
562 rdev->pm.current_sclk = rdev->pm.default_sclk; 562 rdev->pm.current_sclk = rdev->pm.default_sclk;
563 rdev->pm.current_mclk = rdev->pm.default_mclk; 563 rdev->pm.current_mclk = rdev->pm.default_mclk;
564 rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage; 564 if (rdev->pm.power_state) {
565 rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci; 565 rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
566 rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
567 }
566 if (rdev->pm.pm_method == PM_METHOD_DYNPM 568 if (rdev->pm.pm_method == PM_METHOD_DYNPM
567 && rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) { 569 && rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) {
568 rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE; 570 rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE;