From: Dan Carpenter <error27@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Weidong Wang <wangweidong.a@awinic.com>
Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org,
Takashi Iwai <tiwai@suse.com>, Bruce zhao <zhaolei@awinic.com>,
Nick Li <liweilei@awinic.com>, Mark Brown <broonie@kernel.org>,
Colin Ian King <colin.i.king@gmail.com>
Subject: [PATCH] ASoC: codecs: aw88395: Uninitialized variable bug in aw_dev_parse_dev_type_v1()
Date: Mon, 6 Feb 2023 16:58:37 +0300 [thread overview]
Message-ID: <Y+EHjQ0+QCAXxmlh@kili> (raw)
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
next reply other threads:[~2023-02-06 13:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 13:58 Dan Carpenter [this message]
2023-02-06 14:00 ` [PATCH] ASoC: codecs: aw88395: Uninitialized variable bug in aw_dev_parse_dev_type_v1() Mark Brown
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=Y+EHjQ0+QCAXxmlh@kili \
--to=error27@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=liweilei@awinic.com \
--cc=tiwai@suse.com \
--cc=wangweidong.a@awinic.com \
--cc=zhaolei@awinic.com \
/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