]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: rt274: Variable "buf" in function rt274_jack_detect() could be uninitialized
authorYizhuo <yzhai003@ucr.edu>
Mon, 7 Jan 2019 20:12:32 +0000 (12:12 -0800)
committerMark Brown <broonie@kernel.org>
Tue, 8 Jan 2019 13:05:48 +0000 (13:05 +0000)
commitc495a828e7dabb04023d6de840cbd0bf3231ea58
tree7baa4428e79a474db5997f01e8d3b1ed4b226f74
parentc274f5e29d80ebfe08fb31efbc2eb0e68219cf92
ASoC: rt274: Variable "buf" in function rt274_jack_detect() could be uninitialized

In function rt274_jack_detect(), local variable "buf" could
be uninitialized if function regmap_read() returns -EINVAL.
However, it will be used to calculate "hp" and "mic" and
make their value unpredictable while those value are used
in the caller. This is potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt274.c