Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2507899imm; Thu, 7 Jun 2018 11:49:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJooExOSqEa3glIFIdHbX7hKYGsjGbxHaNp8/Id5W9jJqZwXAAaoGRoTMe1jZQ0SpaZ8Htb X-Received: by 2002:a62:4141:: with SMTP id o62-v6mr2820409pfa.111.1528397398779; Thu, 07 Jun 2018 11:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528397398; cv=none; d=google.com; s=arc-20160816; b=wk0WBjvQ7TRbZJHUxksBzKHD34+II8nlMY43iKDPUngG2AylqPj4rOzTSxBN2D0rdO J6iM0Rv5wkt3FjWn+prHnZh27Aq1gwZpZe0+ZBOw8/Om29F5dC7m9wAwOHsX/zgDHo2n bZzGFxsAm/mFvr34SBtV1vKCrFpswAlP6Ft+1Lpu7heqLIAlamDtCF9U1AvDq9YO6B3T auKvOKPUe8+wqbZtvIzcezCfQ0qIJioXZFT7UT65c9p0Ki6W1iAdspEPan6Bq/ZXzQ4c Gd/ROQNiW/aw6GPx028fv3nDrMGAomkMhy0i5UkKfyshh9F4sOc2ab8v6ac/0rNTq6or F4SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=rG1rxkY2CQokN+fdhvz5loy/orofSBbldxVbFMeOQJ8=; b=z+X38imAm4F8NjQy57F1NOFkBiCTgv3LeRciDhiCzbSlHX3p4DNMzDWGWOQR0/HRb9 0r5XmTv38g/ZdkannXOCj88tusUj8S93AnRURFYInHQGfHsTqdK1jU2kqvkhmNN9w/hs Bl9+tej6+4W/svlO4AYTo0IJMYeY6CRWYWitHsKG2UYSkLKVp/HuUjbGafUT4wDgukPv OcE3+B/aMLjWihVBgOHdmd/TfDcwwsy5SfPLQco/8cIGQomXxvDuLD/xVCOmCkPbx+3c tJmmMr47Tqejl6Fpy/OY7pBFz8RVPBgWg/SRBST/Rbiti+cCqnqHtXbAKtE11irW9rB7 NODw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c16-v6si16195542pli.269.2018.06.07.11.49.44; Thu, 07 Jun 2018 11:49:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935824AbeFGPP0 (ORCPT + 99 others); Thu, 7 Jun 2018 11:15:26 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41407 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964826AbeFGPBq (ORCPT ); Thu, 7 Jun 2018 11:01:46 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbu-0005Zn-HT; Thu, 07 Jun 2018 15:09:54 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb0-0002lq-2N; Thu, 07 Jun 2018 15:08:58 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Sebastian Reichel" , "Christophe JAILLET" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 071/410] power: supply: ab8500_charger: Fix an error handling path In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET commit bf59fddde1c3eab89eb8dca8f3d3dc097887d2bb upstream. '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 [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/power/ab8500_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -3224,7 +3224,7 @@ static int ab8500_charger_init_hw_regist } /* Enable backup battery charging */ - abx500_mask_and_set_register_interruptible(di->dev, + ret = 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)