[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_PEFyHP7cOxZOYroGx+Hf1qSuSg+7DUiAakZMc1GcWbsQ@mail.gmail.com>
Date: Mon, 26 Aug 2019 11:16:55 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Alex Deucher <alexander.deucher@....com>,
"David (ChunMing) Zhou" <David1.Zhou@....com>,
David Airlie <airlied@...ux.ie>,
Kevin Wang <kevin1.wang@....com>,
kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Huang Rui <ray.huang@....com>, Daniel Vetter <daniel@...ll.ch>,
Evan Quan <evan.quan@....com>,
Kenneth Feng <kenneth.feng@....com>,
Christian König <christian.koenig@....com>
Subject: Re: [PATCH] drm/amd/powerplay: Fix an off by one in navi10_get_smu_msg_index()
On Mon, Aug 26, 2019 at 9:20 AM Dan Carpenter <dan.carpenter@...cle.com> wrote:
>
> 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>
Applied. thanks!
Alex
> ---
> 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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Powered by blists - more mailing lists