Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: intel/sdw_utils: Assign initial value in asoc_sdw_rt_amp_spk_rtd_init()

Initialize "ret" with "-EINVAL" to handle cases where "strstr()" for
"codec_dai->component->name_prefix" doesn't find "-1" nor "-2". In that
case "name_prefix" is invalid because for current implementation it's
expected to have either "-1" or "-2" in it. (Maybe "-3", "-4" and so on
in the future.)

Link: https://scan5.scan.coverity.com/#/project-view/36179/10063?selectedIssue=1627120
Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
Link: https://patch.msgid.link/20250505185423.680608-1-richard120310@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

I Hsin Cheng and committed by
Mark Brown
5fb38782 04cb269c

+1 -1
+1 -1
sound/soc/sdw_utils/soc_sdw_rt_amp.c
··· 190 190 const struct snd_soc_dapm_route *rt_amp_map; 191 191 char codec_name[CODEC_NAME_SIZE]; 192 192 struct snd_soc_dai *codec_dai; 193 - int ret; 193 + int ret = -EINVAL; 194 194 int i; 195 195 196 196 rt_amp_map = get_codec_name_and_route(dai, codec_name);