Return -EINVAL after an out-of-range core index for PP_OD_EDIT_CCLK_VDDC_TABLE.
Signed-off-by: Candice Li <[email protected]> --- drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c index 0349c73eb00077..717ba46c893312 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -2047,6 +2047,7 @@ static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TAB if (input[0] >= smu->cpu_core_num) { dev_err(smu->adev->dev, "core index is overflow, should be less than %d\n", smu->cpu_core_num); + return -EINVAL; } smu->cpu_core_id_select = input[0]; if (input[1] == 0) { -- 2.25.1
