]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: Intel: sof_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks()
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Mon, 3 Mar 2025 06:55:52 +0000 (14:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Mar 2025 19:54:25 +0000 (12:54 -0700)
commitac4b32cb59ff03a75ad122821ee924cd3fe9fd1c
treefae4a8348053a2e927a2fbb40b12ffb02472dc13
parent0a024f992500162d1f7f28daf058679cc427402f
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: 59bf457d8055 ("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>
sound/soc/intel/boards/sof_sdw.c