]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: cs35l41: Fix use of an uninitialised variable
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 14 Sep 2021 14:13:44 +0000 (15:13 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 15 Sep 2021 12:12:30 +0000 (13:12 +0100)
commit4b17e5900096ab50848b5dd56f85e6d5ec76f7fb
treecf7e1154bfc9aa9860d4c00ca7457731ee91ce32
parentc30592728b3b2f8982d38eeefb7c8dd83ad01a5d
ASoC: cs35l41: Fix use of an uninitialised variable

The loop checking PDN_DONE doesn't check the return value from
regmap_read, nor does it initialise val. This means if regmap_read fails
val will be checked for the PDN_DONE bit whilst being uninitialised.

Fix this up by switching to regmap_read_poll_timeout which tidies up the
code and avoids the uninitialised variable.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210914141349.30218-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs35l41.c