Skip to content

Commit e3a2ef3

Browse files
committed
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 <peter.ujfalusi@linux.intel.com> Cc: stable@vger.kernel.org
1 parent e2b6395 commit e3a2ef3

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
@@ -966,7 +966,7 @@ static int create_sdw_dailinks(struct snd_soc_card *card,
966966

967967
/* generate DAI links by each sdw link */
968968
while (sof_dais->initialised) {
969-
int current_be_id;
969+
int current_be_id = 0;
970970

971971
ret = create_sdw_dailink(card, sof_dais, dai_links,
972972
&current_be_id, codec_conf);

0 commit comments

Comments
 (0)