mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
drm/amd/pm: Add NULL check for power limit
Add NULL check for smu power limit pointer v2: Update error code on failure (Lijo) Signed-off-by: Asad Kamal <asad.kamal@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
e84835940e
commit
42993bcf1c
|
|
@ -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 -EINVAL;
|
||||
|
||||
switch (pp_power_type) {
|
||||
case PP_PWR_TYPE_SUSTAINED:
|
||||
limit_type = SMU_DEFAULT_PPT_LIMIT;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user