[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190826132012.GB6840@mwanda>
Date: Mon, 26 Aug 2019 16:20:12 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Alex Deucher <alexander.deucher@....com>
Cc: Christian König <christian.koenig@....com>,
"David (ChunMing) Zhou" <David1.Zhou@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Kevin Wang <kevin1.wang@....com>,
Huang Rui <ray.huang@....com>,
Kenneth Feng <kenneth.feng@....com>,
Evan Quan <evan.quan@....com>, amd-gfx@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] 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@...cle.com>
---
drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index d7e25f5113f1..fbecd25f150f 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];
--
2.20.1
Powered by blists - more mailing lists