Skip to content

Commit 6b83ba4

Browse files
vijendarmukundabroonie
authored andcommitted
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@vger.kernel.org Fixes: 6d8348d ("ASoC: amd: acp: refactor SoundWire machine driver code") Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://patch.msgid.link/20250506120823.3621604-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4d87ae7 commit 6b83ba4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/amd/acp/acp-sdw-sof-mach.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card,
219219

220220
/* generate DAI links by each sdw link */
221221
while (sof_dais->initialised) {
222-
int current_be_id;
222+
int current_be_id = 0;
223223

224224
ret = create_sdw_dailink(card, sof_dais, dai_links,
225225
&current_be_id, codec_conf);

0 commit comments

Comments
 (0)