From: "Alexey V. Vissarionov" <gremlin@altlinux.org>
To: Jaroslav Kysela <perex@perex.cz>
Cc: alsa-devel@alsa-project.org, lvc-project@linuxtesting.org,
Ian Minett <ian_minett@creativelabs.com>,
ye xingchen <ye.xingchen@zte.com.cn>,
Takashi Iwai <tiwai@suse.com>, Xian Wang <dev@xianwang.io>,
"Alexey V. Vissarionov" <gremlin@altlinux.org>
Subject: [PATCH] ALSA: hda/ca0132: minor fix for allocation size
Date: Tue, 17 Jan 2023 14:15:23 +0300 [thread overview]
Message-ID: <20230117111522.GA15213@altlinux.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]
Although the "dma_chan" pointer occupies more or equal space compared
to "*dma_chan", the allocation size should use the size of variable
itself.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 01ef7dbffb411d9d ("ALSA: hda - Update CA0132 codec to load DSP firmware binary")
Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 0a292bf271f2e59a..acde4cd58785e0cb 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -2455,7 +2455,7 @@ static int dspio_set_uint_param(struct hda_codec *codec, int mod_id,
static int dspio_alloc_dma_chan(struct hda_codec *codec, unsigned int *dma_chan)
{
int status = 0;
- unsigned int size = sizeof(dma_chan);
+ unsigned int size = sizeof(*dma_chan);
codec_dbg(codec, " dspio_alloc_dma_chan() -- begin\n");
status = dspio_scp(codec, MASTERCONTROL, 0x20,
--
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next reply other threads:[~2023-01-17 17:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 11:15 Alexey V. Vissarionov [this message]
2023-01-17 17:02 ` [PATCH] ALSA: hda/ca0132: minor fix for allocation size Takashi Iwai
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=20230117111522.GA15213@altlinux.org \
--to=gremlin@altlinux.org \
--cc=alsa-devel@alsa-project.org \
--cc=dev@xianwang.io \
--cc=ian_minett@creativelabs.com \
--cc=lvc-project@linuxtesting.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=ye.xingchen@zte.com.cn \
/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