ASoC: Intel: sof_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
commit 4363f02a39e25e80e68039b4323c570b0848ec66 upstream.
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: 59bf457d80 ("ASoC: intel: sof_sdw: Factor out SoundWire DAI creation")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: stable@vger.kernel.org
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20250303065552.78328-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0a024f9925
commit
ac4b32cb59
@@ -871,7 +871,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);
|
||||
|
||||
Reference in New Issue
Block a user