Received: by 10.213.65.68 with SMTP id h4csp503504imn; Fri, 16 Mar 2018 09:44:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELuC5oUCADx+YGXwbk+0v7W/6/urdF8Qn3Hf2lhtam5T56JITUO76jt0nNmYyCEiPI3IdPaR X-Received: by 2002:a17:902:5682:: with SMTP id j2-v6mr2804329pli.301.1521218661881; Fri, 16 Mar 2018 09:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218661; cv=none; d=google.com; s=arc-20160816; b=eQr7i0h0l5Z5bhCQgs3bONFV8UXVMZstLzbFhstpGznnpTbf0hIM+wnseTjyNgCZ6C W7MSQOhpNWKAskTJ6JjIWjpSiThAsn3mr3KaHD4ZnkMTFvksQwPnM4lks5sOhUG/2G2U YsO7GzdsrgvUzL/XiondBxd+uT7SyH3CGD180trG7rDSlFsTkCVSaNcbGNogThw31reT nQTQ7bNX9Xpxdak4eawTQs/GR1Ma8Xz+0TqS2pRIB1KMXjokJwdBqmQIo6UXLkSPM+W4 0KvrCwpbBa9kn22S9Lqki33kMM8tu7JTPt7lz7Tne7RERqHRAY7l5WYwBVi965RMvEiI 0ynA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=WQ41bSRDZGuxdWTHpWUcBs+z8KZ1fvCVmPDAfS4ULWA=; b=DLRR0avwza4yHyBQx/Yu/nb3scpP4V45/yf6//XHiBsPvZG8q/sizpFdrOnWx5z43I My25VI0p6z6Gw324wBHtqc/u3sxddSWvV13Et7kxcIjUcxDx/RiE3sVb1AURaiZrQYZE x8ntVVYsKFxFK2/Ne8AnTfXgIMFrw2L+Tri6a1Oiu8TWaBws9kqQF80zfrG1kZ26Eqey baUdkr54tSgp5Bo3tX38X9EYztzZrADQ2s4boZqWSxngHwAzHJW/RPZweO2d3F0mj1ch wu7hCpHbkgieOQri6F+qYiOY5kuFbzESBSwNuZnXNsRczcOO0hTx+0oTACNwHUmfuBIb WLVg== 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 b34-v6si1074963plc.53.2018.03.16.09.44.06; Fri, 16 Mar 2018 09:44:21 -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 S934306AbeCPPgc (ORCPT + 99 others); Fri, 16 Mar 2018 11:36:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40292 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934217AbeCPPg3 (ORCPT ); Fri, 16 Mar 2018 11:36:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 541F31065; Fri, 16 Mar 2018 15:36:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Sebastian Reichel , Sasha Levin Subject: [PATCH 4.14 058/109] power: supply: ab8500_charger: Bail out in case of error in ab8500_charger_init_hw_registers() Date: Fri, 16 Mar 2018 16:23:27 +0100 Message-Id: <20180316152333.100508843@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET [ 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 Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/power/supply/ab8500_charger.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -3221,8 +3221,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,