mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 18:00:53 +07:00
drm/amd/powerplay: Fix an off by one in navi10_get_smu_msg_index()
The navi10_message_map[] array has SMU_MSG_MAX_COUNT elements so the ">" has to be changed to ">=" to prevent reading one element beyond the end of the array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ed8a5fb2a6
commit
5556b9fed1
@ -213,7 +213,7 @@ static int navi10_get_smu_msg_index(struct smu_context *smc, uint32_t index)
|
||||
{
|
||||
struct smu_11_0_cmn2aisc_mapping mapping;
|
||||
|
||||
if (index > SMU_MSG_MAX_COUNT)
|
||||
if (index >= SMU_MSG_MAX_COUNT)
|
||||
return -EINVAL;
|
||||
|
||||
mapping = navi10_message_map[index];
|
||||
|
Loading…
Reference in New Issue
Block a user