Skip to content

Commit 7fe1b93

Browse files
vax-rgregkh
authored andcommitted
ASoC: intel/sdw_utils: Assign initial value in asoc_sdw_rt_amp_spk_rtd_init()
[ Upstream commit 5fb3878 ] 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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent c0a6053 commit 7fe1b93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sdw_utils/soc_sdw_rt_amp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc
190190
const struct snd_soc_dapm_route *rt_amp_map;
191191
char codec_name[CODEC_NAME_SIZE];
192192
struct snd_soc_dai *codec_dai;
193-
int ret;
193+
int ret = -EINVAL;
194194
int i;
195195

196196
rt_amp_map = get_codec_name_and_route(dai, codec_name);

0 commit comments

Comments
 (0)