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>
This commit is contained in:
Yizhuo 2019-01-07 12:12:32 -08:00 • committed by Mark Brown
commit 4a8191aa9e
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0