[PATCH] radeon/pm: Guard access to rdev->pm.power_state array
Alex Deucher
alexdeucher at gmail.com
Wed Jan 8 08:35:05 PST 2014
On Tue, Jan 7, 2014 at 9:40 PM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> 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 at amd.com>
Applied, thanks!
Alex
> ---
> drivers/gpu/drm/radeon/radeon_pm.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index 4f6b7fc..a0ec4bb 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -1024,8 +1024,10 @@ static void radeon_pm_resume_old(struct radeon_device *rdev)
> rdev->pm.current_clock_mode_index = 0;
> rdev->pm.current_sclk = rdev->pm.default_sclk;
> rdev->pm.current_mclk = rdev->pm.default_mclk;
> - rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
> - rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
> + if (rdev->pm.power_state) {
> + rdev->pm.current_vddc = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.voltage;
> + rdev->pm.current_vddci = rdev->pm.power_state[rdev->pm.default_power_state_index].clock_info[0].voltage.vddci;
> + }
> if (rdev->pm.pm_method == PM_METHOD_DYNPM
> && rdev->pm.dynpm_state == DYNPM_STATE_SUSPENDED) {
> rdev->pm.dynpm_state = DYNPM_STATE_ACTIVE;
> --
> 1.8.5.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list