Commit c16d001b authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

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: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 336a1c82
...@@ -101,10 +101,15 @@ static int navi10_message_map[SMU_MSG_MAX_COUNT] = { ...@@ -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) 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 -EINVAL;
return navi10_message_map[index];
val = navi10_message_map[index];
if (val > PPSMC_Message_Count)
return -EINVAL;
return val;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment