* [PATCH] ASoC: codecs: aw88395: Uninitialized variable bug in aw_dev_parse_dev_type_v1()
@ 2023-02-06 13:58 Dan Carpenter
2023-02-06 14:00 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-02-06 13:58 UTC (permalink / raw)
To: Liam Girdwood, Weidong Wang
Cc: alsa-devel, kernel-janitors, Takashi Iwai, Bruce zhao, Nick Li,
Mark Brown, Colin Ian King
The "cur_scene_id" variable is never initialized. It needs to be set
to zero for the code to work.
Fixes: 4345865b003b ("ASoC: codecs: ACF bin parsing and check library file for aw88395")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Presumably this code was tested with CONFIG_CC_HAS_AUTO_VAR_INIT_ZERO=y
or whatever to automatically initialize it to zero or it would have died
specatularly. ;)
sound/soc/codecs/aw88395/aw88395_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/aw88395/aw88395_lib.c b/sound/soc/codecs/aw88395/aw88395_lib.c
index 64dde972f3f0..d7c31a202adc 100644
--- a/sound/soc/codecs/aw88395/aw88395_lib.c
+++ b/sound/soc/codecs/aw88395/aw88395_lib.c
@@ -769,7 +769,7 @@ static int aw_dev_parse_dev_type_v1(struct aw_device *aw_dev,
{
struct aw_cfg_dde_v1 *cfg_dde =
(struct aw_cfg_dde_v1 *)((char *)prof_hdr + prof_hdr->hdr_offset);
- int cur_scene_id;
+ int cur_scene_id = 0;
unsigned int i;
int ret;
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: codecs: aw88395: Uninitialized variable bug in aw_dev_parse_dev_type_v1()
2023-02-06 13:58 [PATCH] ASoC: codecs: aw88395: Uninitialized variable bug in aw_dev_parse_dev_type_v1() Dan Carpenter
@ 2023-02-06 14:00 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-02-06 14:00 UTC (permalink / raw)
To: Dan Carpenter
Cc: Nick Li, alsa-devel, Weidong Wang, kernel-janitors, Takashi Iwai,
Bruce zhao, Liam Girdwood, Colin Ian King
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
On Mon, Feb 06, 2023 at 04:58:37PM +0300, Dan Carpenter wrote:
> The "cur_scene_id" variable is never initialized. It needs to be set
> to zero for the code to work.
Someone already sent a fix for this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-06 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-06 13:58 [PATCH] ASoC: codecs: aw88395: Uninitialized variable bug in aw_dev_parse_dev_type_v1() Dan Carpenter
2023-02-06 14:00 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox