On 5/10/2024 8:20 AM, Jesse Zhang wrote: > Check for specific indexes that may be invalid values. > > Signed-off-by: Jesse Zhang <jesse.zh...@amd.com> > --- > drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > 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 ce941fbb9cfb..a22eb6bbb05e 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; To avoid warning problems, drop index and use PPSMC_MSG_GfxDriverReset instead of index. Thanks, Lijo > 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);
- RE: [PATCH 02/22] drm/amdgpu: the warning dereferen... Zhang, Jesse(Jie)
- RE: [PATCH 02/22] drm/amdgpu: the warning deref... Huang, Tim
- RE: [PATCH 02/22] drm/amdgpu: the warning d... Zhang, Jesse(Jie)
- [PATCH 04/22] drm/amd: fix the warning unchecking return... Jesse Zhang
- [PATCH 03/22] drm/amdgpu: fix the waring dereferencing h... Jesse Zhang
- [PATCH 05/22] drm/amd/pm: check specific index for aldeb... Jesse Zhang
- RE: [PATCH 05/22] drm/amd/pm: check specific index ... Wang, Yang(Kevin)
- RE: [PATCH 05/22] drm/amd/pm: check specific index ... Huang, Tim
- Re: [PATCH 05/22] drm/amd/pm: check specific index ... Lazar, Lijo
- [PATCH 06/22] drm/amd/pm: check the return of send smc m... Jesse Zhang
- [PATCH 07/22] drm/amd/pm: check the return of send smc m... Jesse Zhang
- [PATCH 09/22] drm/amd/pm: check specific index for smu13 Jesse Zhang
- RE: [PATCH 09/22] drm/amd/pm: check specific index ... Wang, Yang(Kevin)
- RE: [PATCH 09/22] drm/amd/pm: check specific index ... Huang, Tim
- RE: [PATCH 09/22] drm/amd/pm: check specific in... Zhang, Jesse(Jie)
- Re: [PATCH 09/22] drm/amd/pm: check specific index ... Lazar, Lijo