From: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx> 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: 59bf457d8055 ("ASoC: intel: sof_sdw: Factor out SoundWire DAI creation") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx> Signed-off-by: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx> Link: https://patch.msgid.link/20250303065552.78328-1-yung-chuan.liao@xxxxxxxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/intel/boards/sof_sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -871,7 +871,7 @@ static int create_sdw_dailinks(struct sn /* 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); Patches currently in stable-queue which might be from peter.ujfalusi@xxxxxxxxxxxxxxx are queue-6.12/asoc-sof-intel-pci-ptl-add-support-for-ptl-h.patch queue-6.12/pci-pci_ids-add-intel_hda_ptl_h.patch queue-6.12/asoc-intel-soc-acpi-intel-mtl-match-declare-adr-as-u.patch queue-6.12/asoc-intel-sof_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch queue-6.12/alsa-hda-intel-dsp-config-add-ptl-h-support.patch queue-6.12/asoc-sof-intel-don-t-check-number-of-sdw-links-when-.patch queue-6.12/alsa-hda-hda-intel-add-panther-lake-h-support.patch queue-6.12/asoc-sof-intel-hda-add-softdep-pre-to-snd-hda-codec-.patch