Commit e9efaaa0 authored by Xiangliang Yu's avatar Xiangliang Yu Committed by Alex Deucher

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: default avatarXiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 84f3f05b
...@@ -1004,12 +1004,12 @@ int amd_powerplay_reset(void *handle) ...@@ -1004,12 +1004,12 @@ int amd_powerplay_reset(void *handle)
if (ret) if (ret)
return ret; return ret;
hw_init_power_state_table(instance->hwmgr);
if ((amdgpu_dpm == 0) if ((amdgpu_dpm == 0)
|| cgs_is_virtualization_enabled(instance->smu_mgr->device)) || cgs_is_virtualization_enabled(instance->smu_mgr->device))
return 0; return 0;
hw_init_power_state_table(instance->hwmgr);
if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL) if (eventmgr == NULL || eventmgr->pp_eventmgr_init == NULL)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment