Skip to content

Commit 4363f02

Browse files
ujfalusibroonie
authored andcommitted
ASoC: Intel: sof_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
Initialize current_be_id to 0 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 Fixes: 59bf457 ("ASoC: intel: sof_sdw: Factor out SoundWire DAI creation") Signed-off-by: Peter Ujfalusi <[email protected]> Cc: [email protected] Reviewed-by: Ranjani Sridharan <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7eb1721 commit 4363f02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/intel/boards/sof_sdw.c

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

955955
/* generate DAI links by each sdw link */
956956
while (sof_dais->initialised) {
957-
int current_be_id;
957+
int current_be_id = 0;
958958

959959
ret = create_sdw_dailink(card, sof_dais, dai_links,
960960
&current_be_id, codec_conf);

0 commit comments

Comments
 (0)