[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230307040938.7484-5-trevor.wu@mediatek.com>
Date: Tue, 7 Mar 2023 12:09:38 +0800
From: Trevor Wu <trevor.wu@...iatek.com>
To: <broonie@...nel.org>, <lgirdwood@...il.com>, <tiwai@...e.com>,
<perex@...ex.cz>, <matthias.bgg@...il.com>,
<angelogioacchino.delregno@...labora.com>
CC: <trevor.wu@...iatek.com>, <jiaxin.yu@...iatek.com>,
<alsa-devel@...a-project.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH 4/4] 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@...iatek.com>
---
sound/soc/codecs/mt6359.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.18.0
Powered by blists - more mailing lists