]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
6080de42a70d6e9c31904d112b8eb735f56c172c
[thirdparty/kernel/stable-queue.git] /
1 From 6b83ba4bc3ecb915476d688c9f00f3be57b49a0c Mon Sep 17 00:00:00 2001
2 From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
3 Date: Tue, 6 May 2025 17:37:23 +0530
4 Subject: ASoC: amd: sof_amd_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
5
6 From: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
7
8 commit 6b83ba4bc3ecb915476d688c9f00f3be57b49a0c upstream.
9
10 Initialize current_be_id to 0 in SOF based AMD generic SoundWire machine
11 driver to handle the unlikely case when there are no devices connected to
12 a DAI.
13 In this case create_sdw_dailink() would return without touching the passed
14 pointer to current_be_id.
15
16 Found by gcc -fanalyzer
17
18 Cc: stable@vger.kernel.org
19 Fixes: 6d8348ddc56ed ("ASoC: amd: acp: refactor SoundWire machine driver code")
20 Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
21 Link: https://patch.msgid.link/20250506120823.3621604-2-Vijendar.Mukunda@amd.com
22 Signed-off-by: Mark Brown <broonie@kernel.org>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 ---
25 sound/soc/amd/acp/acp-sdw-sof-mach.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c
29 +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c
30 @@ -267,7 +267,7 @@ static int create_sdw_dailinks(struct sn
31
32 /* generate DAI links by each sdw link */
33 while (sof_dais->initialised) {
34 - int current_be_id;
35 + int current_be_id = 0;
36
37 ret = create_sdw_dailink(card, sof_dais, dai_links,
38 &current_be_id, codec_conf);