From: Candice Li Date: Tue, 19 May 2026 04:19:38 +0000 (+0800) Subject: drm/amd/pm: return -EINVAL on invalid CCLK OD core index X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d288e4ba09b25e4602685ac4203185a7bda38b0d;p=thirdparty%2Fkernel%2Fstable.git drm/amd/pm: return -EINVAL on invalid CCLK OD core index Return -EINVAL after an out-of-range core index for PP_OD_EDIT_CCLK_VDDC_TABLE. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- 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 d269b505aefb7..016a5c893fee5 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c @@ -2046,6 +2046,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) {