diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-03-14 15:49:54 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-03-15 09:23:35 +0000 |
commit | dd5dc001581a7cf6f563e188c302caae1be998c2 (patch) | |
tree | a2352a4b9c8a047336eaa3280ab9a4a56bae4285 /lib/string_helpers.c | |
parent | d4a6360f19c1c551afcba42be98df04651fab31b (diff) | |
download | op-kernel-dev-dd5dc001581a7cf6f563e188c302caae1be998c2.zip op-kernel-dev-dd5dc001581a7cf6f563e188c302caae1be998c2.tar.gz |
ASoC: cs35l32: avoid uninitialized variable access
gcc warns about the possibilty of accessing a property read from
devicetree in cs35l32_i2c_probe() when it has not been initialized
because CONFIG_OF is disabled:
sound/soc/codecs/cs35l32.c: In function 'cs35l32_i2c_probe':
sound/soc/codecs/cs35l32.c:278:2: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
The code is actually correct because it checks the dev->of_node
variable first and we know this is NULL here when CONFIG_OF
is disabled, but Russell King noticed that it's broken when
we probe the device using DT, and the properties are absent.
The code already has some checking for incorrect values, and
I keep that checking unchanged here, but add an additional
check for an error returned by the property accessor functions
that now gets handled the same way as incorrect data in the
properties.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions