--- Begin Message ---
- To: <broonie@xxxxxxxxxx>, <lgirdwood@xxxxxxxxx>, <tiwai@xxxxxxxx>, <perex@xxxxxxxx>, <matthias.bgg@xxxxxxxxx>, <angelogioacchino.delregno@xxxxxxxxxxxxx>
- Subject: [PATCH 2/4] ASoC: mediatek: mt9195-mt6359: fix UNINIT problem
- From: Trevor Wu <trevor.wu@xxxxxxxxxxxx>
- Date: Tue, 7 Mar 2023 12:09:36 +0800
- Cc: trevor.wu@xxxxxxxxxxxx, jiaxin.yu@xxxxxxxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- In-reply-to: <20230307040938.7484-1-trevor.wu@mediatek.com>
- References: <20230307040938.7484-1-trevor.wu@mediatek.com>
Coverity shows using uninitialized value monitor. When regmap_read
returns an error, monitor keeps the value left from earlier
computation. To prevent from the unexpected result in the case, assign
0 to monitor.
Signed-off-by: Trevor Wu <trevor.wu@xxxxxxxxxxxx>
---
sound/soc/mediatek/mt8195/mt8195-mt6359.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359.c b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
index 4682748d82be..ceca882ecff7 100644
--- a/sound/soc/mediatek/mt8195/mt8195-mt6359.c
+++ b/sound/soc/mediatek/mt8195/mt8195-mt6359.c
@@ -158,7 +158,7 @@ static int mt8195_mt6359_mtkaif_calibration(struct snd_soc_pcm_runtime *rtd)
int mtkaif_phase_cycle[MT8195_MTKAIF_MISO_NUM];
int mtkaif_calibration_num_phase;
bool mtkaif_calibration_ok;
- unsigned int monitor;
+ unsigned int monitor = 0;
int counter;
int phase;
int i;
--
2.18.0
--- End Message ---