From: Jesse Zhang Date: Wed, 8 May 2024 09:13:28 +0000 (+0800) Subject: drm/amd/pm: check specific index for aldebaran X-Git-Tag: v6.11-rc1~141^2~25^2~236 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ce8ef2639c112ae203c985b758389e378630aac;p=thirdparty%2Fkernel%2Flinux.git drm/amd/pm: check specific index for aldebaran Check for specific indexes that may be invalid values. Signed-off-by: Jesse Zhang Reviewed-by: Yang Wang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index ce941fbb9cfbe..a22eb6bbb05ed 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -1886,7 +1886,8 @@ static int aldebaran_mode2_reset(struct smu_context *smu) index = smu_cmn_to_asic_specific_index(smu, CMN2ASIC_MAPPING_MSG, SMU_MSG_GfxDeviceDriverReset); - + if (index < 0 ) + return -EINVAL; mutex_lock(&smu->message_lock); if (smu->smc_fw_version >= 0x00441400) { ret = smu_cmn_send_msg_without_waiting(smu, (uint16_t)index, SMU_RESET_MODE_2);