mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-12 17:26:44 +07:00
drm/amdgpu: fix the issue of checking on message mapping
The navi10_message_map[index] scope should be in PPSMC_Message_Count not in SMU_MSG_MAX_COUNT. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
336a1c825e
commit
c16d001bf2
@ -101,10 +101,15 @@ static int navi10_message_map[SMU_MSG_MAX_COUNT] = {
|
||||
|
||||
static int navi10_get_smu_msg_index(struct smu_context *smc, uint32_t index)
|
||||
{
|
||||
if (index > SMU_MSG_MAX_COUNT || index > PPSMC_Message_Count)
|
||||
int val;
|
||||
if (index > SMU_MSG_MAX_COUNT)
|
||||
return -EINVAL;
|
||||
return navi10_message_map[index];
|
||||
|
||||
val = navi10_message_map[index];
|
||||
if (val > PPSMC_Message_Count)
|
||||
return -EINVAL;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user