[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250506120823.3621604-2-Vijendar.Mukunda@amd.com>
Date: Tue, 6 May 2025 17:37:23 +0530
From: Vijendar Mukunda <Vijendar.Mukunda@....com>
To: <broonie@...nel.org>
CC: <alsa-devel@...a-project.org>, <lgirdwood@...il.com>, <perex@...ex.cz>,
<tiwai@...e.com>, <yung-chuan.liao@...ux.intel.com>,
<ranjani.sridharan@...ux.intel.com>, <pierre-louis.bossart@...ux.dev>,
<Basavaraj.Hiregoudar@....com>, <Sunil-kumar.Dommati@....com>,
<venkataprasad.potturu@....com>, <Mario.Limonciello@....com>,
<linux-sound@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Vijendar
Mukunda" <Vijendar.Mukunda@....com>, <stable@...r.kernel.org>
Subject: [PATCH 2/3] ASoC: amd: sof_amd_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
Initialize current_be_id to 0 in SOF based AMD generic SoundWire machine
driver to handle the unlikely case when there are no devices connected to
a DAI.
In this case create_sdw_dailink() would return without touching the passed
pointer to current_be_id.
Found by gcc -fanalyzer
Cc: stable@...r.kernel.org
Fixes: 6d8348ddc56ed ("ASoC: amd: acp: refactor SoundWire machine driver code")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@....com>
---
sound/soc/amd/acp/acp-sdw-sof-mach.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c
index c09b1f118a6c..75bdd843ca36 100644
--- a/sound/soc/amd/acp/acp-sdw-sof-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c
@@ -219,7 +219,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card,
/* generate DAI links by each sdw link */
while (sof_dais->initialised) {
- int current_be_id;
+ int current_be_id = 0;
ret = create_sdw_dailink(card, sof_dais, dai_links,
¤t_be_id, codec_conf);
--
2.45.2
Powered by blists - more mailing lists