Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2431219imm; Thu, 7 Jun 2018 10:27:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6WevRFyPu3aL5d0GgS15rycg25Sy8iNMk+LH3BG3tRv3KdRNjPohSQejlzrAbqhH1NutP X-Received: by 2002:a63:920c:: with SMTP id o12-v6mr2320695pgd.233.1528392422796; Thu, 07 Jun 2018 10:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528392422; cv=none; d=google.com; s=arc-20160816; b=yxLCzLU7EGjgBMvEUtTaGCny+u8MDpzcirgeX+DXIoOm4g7wFl2EpxDTLsfQnEghOY qxPQvB7DUCZb0zLjsBFqKwLjNvW5T++xaydCQqzW0Bi8jdxpWtuLmudLp3ojOV1ArQxt fmmqnBoe6k8mKZjmGWtR+6lmhjwBcSrSTvrfD1IKloo83qnZtJ4Ae7kvWSqiNS4z5Vm9 TAH2lF978iMDQptoUi8m78gKSTcHCH959SOHrPeMyuyg9e2PSgz9mIZqIHLJxX/u76O+ bTldrv4+4/qXHEJvCR29Yedc2I1PHT1+z/+Pf0bjNLU1fPGRKnowRFnpkL9PiYaNZAPC nwVQ== 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=L69JiIARmzSWGVQrGFGZ18SderQ70O3EpmRT9vExbu4=; b=rVjTVypVRwqcgcjlZAjHvk48lTff6VBF8heRFvXsUQFH2oGas7Zj/1HY4s3L7ls44/ +3BbY8yzDIt4oMk1GqbiJVGu3zGUWx4kOKhKd5cpxNLzSGFGSFaHBDSzEKKwa67tgoQ9 pxyg19qr+Vb4ea6xSm7M5JP1HcSJ9kZWTJ4524jtUMVAiNNPfqfJrHFQjEogGYN/HOin e6j5BENwzwGuF0v5mJfxVRAeeTXiDe0U/Ag4yoYN3CwE3Y+2yDEWFDTOJ3vsPgRf7zyb PK54At5uvWjJnzTERMS0/41QC414l4Vrij0NRnzl3gmI7WcCNlzzfQHGhFd1tpr1dvP0 xhIA== 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 y23-v6si2873401pfk.75.2018.06.07.10.26.47; Thu, 07 Jun 2018 10:27:02 -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 S933856AbeFGOdA (ORCPT + 99 others); Thu, 7 Jun 2018 10:33:00 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40294 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933338AbeFGOcy (ORCPT ); Thu, 7 Jun 2018 10:32:54 -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-0005dI-Fi; Thu, 07 Jun 2018 15:09:54 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb0-0002lu-49; 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, "Christophe JAILLET" , "Sebastian Reichel" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 072/410] power: supply: ab8500_charger: Bail out in case of error in 'ab8500_charger_init_hw_registers()' 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 09edcb647542487864e23aa8d2ef26be3e08978a upstream. 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 Signed-off-by: Sebastian Reichel [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/power/ab8500_charger.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c @@ -3227,8 +3227,10 @@ static int ab8500_charger_init_hw_regist 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) + if (ret < 0) { dev_err(di->dev, "%s mask and set failed\n", __func__); + goto out; + } if (is_ab8540(di->parent)) { ret = abx500_mask_and_set_register_interruptible(di->dev,