mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue