Skip to content
Commit 69128316 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown
Browse files

ASoC: dapm: Fix uninitialized variable in snd_soc_dapm_get_enum_double()



If soc_dapm_read() fails, reg_val will be uninitialized, and bogus
values will be written later:

sound/soc/soc-dapm.c: In function 'snd_soc_dapm_get_enum_double':
sound/soc/soc-dapm.c:2862:15: warning: 'reg_val' may be used uninitialized in this function [-Wmaybe-uninitialized]
  unsigned int reg_val, val;
               ^

Return early on error to fix this.

Introduced by commit ce0fc93a ("ASoC:
Add DAPM support at the component level").

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
parent ae34a78c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment