mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 11:45:13 +07:00
drm/amd/powerplay: Off by one in vega20_get_smu_msg_index()
The > should be >= so that we don't read one element beyond the end of
the vega20_message_map[] array.
Fixes: 78031c2c4d
("drm/amd/powerplay: implement smu vega20_message_map for vega20")
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
06b61d4a3c
commit
8513027a73
@ -132,7 +132,8 @@ static int vega20_message_map[SMU_MSG_MAX_COUNT] = {
|
||||
static int vega20_get_smu_msg_index(struct smu_context *smc, uint32_t index)
|
||||
{
|
||||
int val;
|
||||
if (index > SMU_MSG_MAX_COUNT)
|
||||
|
||||
if (index >= SMU_MSG_MAX_COUNT)
|
||||
return -EINVAL;
|
||||
|
||||
val = vega20_message_map[index];
|
||||
|
Loading…
Reference in New Issue
Block a user