summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/mt6359.c
diff options
context:
space:
mode:
authorTrevor Wu <trevor.wu@mediatek.com>2023-03-07 05:09:38 +0100
committerMark Brown <broonie@kernel.org>2023-03-13 15:08:39 +0100
commit3a60fa4c063dacc5eb66660aa23107f3cb8a477e (patch)
treeff65ae41c1e0e9ebfbf2db8c48afc0ec09fd8999 /sound/soc/codecs/mt6359.c
parentASoC: mediatek: mt6358: fix UNINIT problem (diff)
downloadlinux-3a60fa4c063dacc5eb66660aa23107f3cb8a477e.tar.xz
linux-3a60fa4c063dacc5eb66660aa23107f3cb8a477e.zip
ASoC: mediatek: mt6359: fix UNINIT problem
Coverity shows decaring variable reg without initializer. When regmap_read returns an error, reg keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to reg. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/mt6359.c')
-rw-r--r--sound/soc/codecs/mt6359.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c
index c9a453ce8a2a..cb487e63615c 100644
--- a/sound/soc/codecs/mt6359.c
+++ b/sound/soc/codecs/mt6359.c
@@ -358,7 +358,7 @@ static int mt6359_put_volsw(struct snd_kcontrol *kcontrol,
struct mt6359_priv *priv = snd_soc_component_get_drvdata(component);
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
- unsigned int reg;
+ unsigned int reg = 0;
int index = ucontrol->value.integer.value[0];
int ret;