summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/mt6358.c
diff options
context:
space:
mode:
authorTrevor Wu <trevor.wu@mediatek.com>2023-03-07 12:09:37 +0800
committerMark Brown <broonie@kernel.org>2023-03-13 14:08:38 +0000
commit9760e01b3851dc51d1901876668168328d34a647 (patch)
treed6d2b2f905839efe8a33cf8de70d2389bd5477be /sound/soc/codecs/mt6358.c
parent1a3f0116b74ba2f9477c28fcf9d66ac7126455fd (diff)
ASoC: mediatek: mt6358: 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-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/mt6358.c')
-rw-r--r--sound/soc/codecs/mt6358.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c
index b54610b27906..d7b157ddc9a8 100644
--- a/sound/soc/codecs/mt6358.c
+++ b/sound/soc/codecs/mt6358.c
@@ -429,7 +429,7 @@ static int mt6358_put_volsw(struct snd_kcontrol *kcontrol,
struct mt6358_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 ret;
ret = snd_soc_put_volsw(kcontrol, ucontrol);