summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-02-15 16:33:13 +0000
committerMark Brown <broonie@kernel.org>2021-03-10 12:48:28 +0000
commit0c0a5883783540a56e6a5dbf5868f045dbeaa888 (patch)
tree00d836416718987eb1d46966d99d075a03605a56 /sound
parent0d2b6e398975bcc6a29f1d466229a312dde71b53 (diff)
ASoC: codecs: lpass-rx-macro: Fix uninitialized variable ec_tx
There is potential read of the uninitialized variable ec_tx if the call to snd_soc_component_read fails or returns an unrecognized w->name. To avoid this corner case, initialize ec_tx to -1 so that it is caught later when ec_tx is bounds checked. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 4f692926f562 ("ASoC: codecs: lpass-rx-macro: add dapm widgets and route") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210215163313.84026-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/lpass-rx-macro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index c9c21d22c2c4..8c04b3b2c907 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -2895,7 +2895,7 @@ static int rx_macro_enable_echo(struct snd_soc_dapm_widget *w,
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
u16 val, ec_hq_reg;
- int ec_tx;
+ int ec_tx = -1;
val = snd_soc_component_read(component,
CDC_RX_INP_MUX_RX_MIX_CFG4);