]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/pm: check specific index for smu13
authorJesse Zhang <jesse.zhang@amd.com>
Wed, 8 May 2024 09:50:21 +0000 (17:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 20:11:53 +0000 (16:11 -0400)
Check for specific indexes that may be invalid values.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Suggested-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

index 051092f1b1b4a0a9d346fe9c46bc3aa102d64b38..46ab70a244af8a9f1efd228a8b3d443dcbb18d38 100644 (file)
@@ -2336,6 +2336,8 @@ static int smu_v13_0_6_mode2_reset(struct smu_context *smu)
 
        index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG,
                                               SMU_MSG_GfxDeviceDriverReset);
+       if (index < 0)
+               return index;
 
        mutex_lock(&smu->message_lock);