Skip to content

Commit 7bc4a79

Browse files
vijendarmukundasmb49
authored andcommitted
ASoC: amd: amd_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
BugLink: https://bugs.launchpad.net/bugs/2120812 commit 4d87ae7508cb7ff58fd0bcecc6e9491f42f987f8 upstream. Initialize current_be_id to 0 in AMD legacy stack(NO DSP enabled) SoundWire generic machine driver code 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: 2981d9b ("ASoC: amd: acp: add soundwire machine driver for legacy stack") Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://patch.msgid.link/20250506120823.3621604-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 0ecc8c0 commit 7bc4a79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

264264
/* generate DAI links by each sdw link */
265265
while (soc_dais->initialised) {
266-
int current_be_id;
266+
int current_be_id = 0;
267267

268268
ret = create_sdw_dailink(card, soc_dais, dai_links,
269269
&current_be_id, codec_conf, sdw_platform_component);

0 commit comments

Comments
 (0)