mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 21:54:06 +08:00
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
This commit is contained in:
parent
84f3f05b44
commit
e9efaaa047
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user