mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-23 06:47:04 -04: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user