]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ASoC: soc-pcm: fix the return value in dpcm_apply_symmetry()
authorJaroslav Kysela <perex@perex.cz>
Mon, 14 Jun 2021 07:17:46 +0000 (09:17 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 20 Sep 2021 13:39:54 +0000 (15:39 +0200)
BugLink: https://bugs.launchpad.net/bugs/1939738
[ Upstream commit 12ffd726824a2f52486f72338b6fd3244b512959 ]

In case, where the loops are not executed for a reason, the uninitialized
variable 'err' is returned to the caller. Make code fully predictible
and assign zero in the declaration.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Mark Brown <broonie@kernel.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20210614071746.1787072-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
sound/soc/soc-pcm.c

index ee51dc7fd8937b0d0c886f3b2f19b680db04b5f1..9a421010ef435160b741d8e34c527ad213fddf09 100644 (file)
@@ -1739,7 +1739,7 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,
        struct snd_soc_dpcm *dpcm;
        struct snd_soc_pcm_runtime *fe = asoc_substream_to_rtd(fe_substream);
        struct snd_soc_dai *fe_cpu_dai;
-       int err;
+       int err = 0;
        int i;
 
        /* apply symmetry for FE */