diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-08-26 16:20:12 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-08-27 08:16:08 -0500 |
commit | 5556b9fed171bbfb53b08b56aef65201fcc4b4b1 (patch) | |
tree | 57265b319553cd40b7b5fb4e248e475ae89c2a0f /drivers/gpu/drm/amd/powerplay | |
parent | ed8a5fb2a606b6dfc6e417da6e64efcbb899e4cc (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c index 6f96ed7b9775..9f738c642268 100644 --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c @@ -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]; |