diff options
author | Alexander Müller <serveralex@gmail.com> | 2011-12-30 12:55:48 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-01-03 04:17:16 -0500 |
commit | 4376eee92e5a8332b470040e672ea99cd44c826a (patch) | |
tree | d26e398b57d3d907423eb709f9e221d9fe1ab616 | |
parent | 115e8e705e4be071b9e06ff72578e3b603f2ba65 (diff) |
drm/radeon/kms/atom: fix possible segfault in pm setup
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>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 6 |
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 d24baf30efcb..5082d17d14dc 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -2560,7 +2560,11 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
2560 | 2560 | ||
2561 | rdev->pm.current_power_state_index = rdev->pm.default_power_state_index; | 2561 | rdev->pm.current_power_state_index = rdev->pm.default_power_state_index; |
2562 | rdev->pm.current_clock_mode_index = 0; | 2562 | rdev->pm.current_clock_mode_index = 0; |
2563 | rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage; | 2563 | if (rdev->pm.default_power_state_index >= 0) |
2564 | rdev->pm.current_vddc = | ||
2565 | rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage; | ||
2566 | else | ||
2567 | rdev->pm.current_vddc = 0; | ||
2564 | } | 2568 | } |
2565 | 2569 | ||
2566 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable) | 2570 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable) |