drm/amd/pm: Add NULL check for power limit
Subsystems (3)
PATCH 1/1 drm/amd/pm: Add NULL check for power limit
Add NULL check for smu power limit pointer
Signed-off-by Asad Kamal <[email protected]>
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -0
@@ -2907,6 +2907,9 @@ int smu_get_power_limit(void *handle,if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)return -EOPNOTSUPP ; +if (!limit) +return -ENOMEM ; +switch (pp_power_type) {case PP_PWR_TYPE_SUSTAINED : limit_type =SMU_DEFAULT_PPT_LIMIT ;
Signature · 1 line
2.46.0