]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:03 +0000 (10:08 +0100)
commit1f1408d9088c3bb2ce9c4ca066f24b3e147ba14e
treee6b2fe5e6b5f023fcc017259eb450cc0052c0f7b
parentb0d7f5c733ca24aa549a54f78333102b4d197a24
mfd: mc13xxx: Fix a missing check of a register-read failure

[ Upstream commit 9e28989d41c0eab57ec0bb156617a8757406ff8a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mfd/mc13xxx-core.c