]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/pm: return -EINVAL on invalid CCLK OD core index
authorCandice Li <candice.li@amd.com>
Tue, 19 May 2026 04:19:38 +0000 (12:19 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Jun 2026 17:52:49 +0000 (13:52 -0400)
Return -EINVAL after an out-of-range core index for
PP_OD_EDIT_CCLK_VDDC_TABLE.

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c

index d269b505aefb71ee0048ecbfb95efe04fed23ec1..016a5c893fee56c64c106167c463251d10fa629d 100644 (file)
@@ -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) {