diff options
author | Xiangliang Yu <Xiangliang.Yu@amd.com> | 2016-11-30 07:07:16 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-12-07 00:08:38 +0100 |
commit | e9efaaa047b1aebda27b5b65f17c752eb079e51b (patch) | |
tree | 764bfdd14e3eb5c12d63edda3e4688a218f77868 | |
parent | drm/amdgpu: Don't touch GFX hw during HW fini (diff) | |
download | linux-e9efaaa047b1aebda27b5b65f17c752eb079e51b.tar.xz linux-e9efaaa047b1aebda27b5b65f17c752eb079e51b.zip |
drm/amd/powerplay: Fix potential NULL pointer issue
If doesn't enable dpm, the powerplay will not allocate memory for
hw management. So, hw_init_power_state_table function will reference
NULL pointer when resetting.
Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 51a36077b993..c81cf1412728 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -1004,12 +1004,12 @@ int amd_powerplay_reset(void *handle) if (ret) return ret; - hw_init_power_state_table(instance->hwmgr); - if ((amdgpu_dpm == 0) || cgs_is_virtualization_enabled(instance->smu_mgr->device)) return 0; + hw_init_power_state_table(instance->hwmgr); + if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL) return -EINVAL; |