]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: mc13xxx: Fix a missing check of a register-read failure
authorKangjie Lu <kjlu@umn.edu>
Thu, 20 Dec 2018 21:12:11 +0000 (15:12 -0600)
committerLee Jones <lee.jones@linaro.org>
Thu, 3 Jan 2019 08:32:42 +0000 (08:32 +0000)
commitd3d7c7c3585d42b6c4937e844bcc1228d12497e8
treeab5f7df3b3e29b46f3ae67093d1047a60122972b
parent1af6e1542799f379449ce729150681b172f0eb10
mfd: mc13xxx: Fix a missing check of a register-read failure

When mc13xxx_reg_read() fails, "old_adc0" is uninitialized and will
contain random value. Further execution uses "old_adc0" even when
mc13xxx_reg_read() fails.
The fix checks the return value of mc13xxx_reg_read(), and exits
the execution when it fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/mc13xxx-core.c