power: supply: ab8500_charger: Fix an error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 22 Nov 2017 20:27:31 +0000 (21:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 07:42:50 +0000 (08:42 +0100)
commit487d43596072b2e66e2bc6037c357e5b3c1bd026
tree1acffa22ffbbfd2ec9d47f69cd36b71aa26ad158
parent7579edac03e6f155bdb94b354d74a3a2cb9eeaec
power: supply: ab8500_charger: Fix an error handling path

[ Upstream commit bf59fddde1c3eab89eb8dca8f3d3dc097887d2bb ]

'ret' is know to be 0 at this point, because it has not been updated by the
the previous call to 'abx500_mask_and_set_register_interruptible()'.

Fix it by updating 'ret' before checking if an error occurred.

Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/ab8500_charger.c