power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_r...
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 22 Nov 2017 20:31:20 +0000 (21:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 07:42:50 +0000 (08:42 +0100)
commit893bfd501781fc9d719a976f13db7859b8781de6
tree8f718dfc916640b147d8ed4c3e7ca0fd8374970c
parent487d43596072b2e66e2bc6037c357e5b3c1bd026
power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()'

[ Upstream commit 09edcb647542487864e23aa8d2ef26be3e08978a ]

If an error occurs when we enable the backup battery charging, we should
go through the error handling path directly.

Before commit db43e6c473b5 ("ab8500-bm: Add usb power path support") this
was the case, but this commit has added some code between the last test and
the 'out' label.
So, in case of error, this added code is executed and the error may be
silently ignored.

Fix it by adding the missing 'goto out', as done in all other error
handling paths.

Fixes: db43e6c473b5 ("ab8500-bm: Add usb power path support")
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