diff options
author | Edward O'Callaghan <funfunctor@folklore1984.net> | 2017-04-21 22:40:55 +1000 |
---|---|---|
committer | Edward O'Callaghan <funfunctor@folklore1984.net> | 2017-04-21 22:40:55 +1000 |
commit | 818d53e12c758f08084d3bfa8e98aa73289a1287 (patch) | |
tree | 13e899e9da9420440a0889bdd0299b7dcda4055e | |
parent | c154165e93b7f1ee9c63906fa200bc735098d47d (diff) |
drm/amdgpu: Fix null ptr dereference in SI dpm supportbug100058
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100058
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/si_dpm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c index c5dec210d529..16a1d48225eb 100644 --- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c @@ -1961,9 +1961,9 @@ static struct rv7xx_power_info *rv770_get_pi(struct amdgpu_device *adev) static struct ni_power_info *ni_get_pi(struct amdgpu_device *adev) { - struct ni_power_info *pi = adev->pm.dpm.priv; + struct si_power_info *si_pi = adev->pm.dpm.priv; - return pi; + return si_pi->ni; } static struct si_ps *si_get_ps(struct amdgpu_ps *aps) @@ -2372,9 +2372,10 @@ static bool si_should_disable_uvd_powertune(struct amdgpu_device *adev, struct evergreen_power_info *evergreen_get_pi(struct amdgpu_device *adev) { - struct evergreen_power_info *pi = adev->pm.dpm.priv; + struct si_power_info *si_pi = adev->pm.dpm.priv; + struct ni_info *ni_pi = si_pi->ni; - return pi; + return ni_pi->eg; } static int si_populate_power_containment_values(struct amdgpu_device *adev, |