drivers/regulator: fix a missing check of return value
authorKangjie Lu <kjlu@umn.edu>
Wed, 19 Dec 2018 05:04:13 +0000 (23:04 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:36 +0000 (15:37 +0100)
commitb63cd67875dda7d041f0febc2bb5453361b8b101
tree2e3a7e9f9ad792ea3f54bd8bb41733f38506a823
parentf871fc2e6ad9a83f30343a7ebfee2130cad4c496
drivers/regulator: fix a missing check of return value

[ Upstream commit 966e927bf8cc6a44f8b72582a1d6d3ffc73b12ad ]

If palmas_smps_read() fails, we should not use the read data in "reg"
which may contain random value. The fix inserts a check for the return
value of palmas_smps_read(): If it fails, we return the error code
upstream and stop using "reg".

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/palmas-regulator.c