From: Alex Deucher <alexdeucher@gmail.com>
To: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Sunil-kumar.Dommati@amd.com, "David Airlie" <airlied@linux.ie>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"open list" <linux-kernel@vger.kernel.org>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
dan.carpenter@oracle.com
Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access
Date: Wed, 27 Jul 2022 10:55:12 -0400 [thread overview]
Message-ID: <CADnq5_PKjmNw+bAPCyDu_G=yNQcpJSpFd+EVzNwfNWzig8apFw@mail.gmail.com> (raw)
In-Reply-To: <20220727144249.415228-1-Vijendar.Mukunda@amd.com>
On Wed, Jul 27, 2022 at 10:42 AM Vijendar Mukunda
<Vijendar.Mukunda@amd.com> wrote:
>
> Fixed following Smatch static checker warning:
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:393 acp_hw_init()
> error: buffer overflow 'i2s_pdata' 3 <= 3
> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:396 acp_hw_init()
> error: buffer overflow 'i2s_pdata' 3 <= 3
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> index bcc7ee02e0fc..6d72355ac492 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> @@ -390,14 +390,6 @@ static int acp_hw_init(void *handle)
> i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET;
> i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET;
>
> - i2s_pdata[3].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET;
> - switch (adev->asic_type) {
> - case CHIP_STONEY:
> - i2s_pdata[3].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE;
> - break;
> - default:
> - break;
> - }
Is this actually not used or should we just increase the allocation size?
Alex
> adev->acp.acp_res[0].name = "acp2x_dma";
> adev->acp.acp_res[0].flags = IORESOURCE_MEM;
> adev->acp.acp_res[0].start = acp_base;
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-07-27 14:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-27 14:42 [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access Vijendar Mukunda
2022-07-27 14:55 ` Alex Deucher [this message]
2022-07-27 15:20 ` Mukunda,Vijendar
2022-07-27 15:22 ` Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADnq5_PKjmNw+bAPCyDu_G=yNQcpJSpFd+EVzNwfNWzig8apFw@mail.gmail.com' \
--to=alexdeucher@gmail.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).