* [PATCH] ALSA: hda/ca0132: minor fix for allocation size
@ 2023-01-17 11:15 Alexey V. Vissarionov
2023-01-17 17:02 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Alexey V. Vissarionov @ 2023-01-17 11:15 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: alsa-devel, lvc-project, Ian Minett, ye xingchen, Takashi Iwai,
Xian Wang, Alexey V. Vissarionov
[-- 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 --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda/ca0132: minor fix for allocation size
2023-01-17 11:15 [PATCH] ALSA: hda/ca0132: minor fix for allocation size Alexey V. Vissarionov
@ 2023-01-17 17:02 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2023-01-17 17:02 UTC (permalink / raw)
To: Alexey V. Vissarionov
Cc: alsa-devel, lvc-project, Ian Minett, ye xingchen, Takashi Iwai,
Xian Wang
On Tue, 17 Jan 2023 12:15:23 +0100,
Alexey V. Vissarionov wrote:
>
> 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>
Thanks, applied now.
(BTW, the Fixes tag should have the commit ID in 12 chars. I
corrected locally.)
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-17 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-17 11:15 [PATCH] ALSA: hda/ca0132: minor fix for allocation size Alexey V. Vissarionov
2023-01-17 17:02 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.