Return-Path: Received: from mail-by2nam01on0114.outbound.protection.outlook.com ([104.47.34.114]:45301 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932736AbeCCW2z (ORCPT ); Sat, 3 Mar 2018 17:28:55 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Christophe JAILLET , Sebastian Reichel , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 33/84] power: supply: ab8500_charger: Fix an error handling path Date: Sat, 3 Mar 2018 22:26:19 +0000 Message-ID: <20180303222518.26271-33-alexander.levin@microsoft.com> References: <20180303222518.26271-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222518.26271-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Christophe JAILLET [ 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 Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/ab8500_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/a= b8500_charger.c index 4ebbcce45c48..1cdbe7a0738d 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -3218,7 +3218,7 @@ static int ab8500_charger_init_hw_registers(struct ab= 8500_charger *di) } =20 /* Enable backup battery charging */ - abx500_mask_and_set_register_interruptible(di->dev, + ret =3D abx500_mask_and_set_register_interruptible(di->dev, AB8500_RTC, AB8500_RTC_CTRL_REG, RTC_BUP_CH_ENA, RTC_BUP_CH_ENA); if (ret < 0) --=20 2.14.1