Received: by 10.213.65.68 with SMTP id h4csp27071imn; Mon, 19 Mar 2018 18:23:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELuaEP3wF9GQNJy+ke2IVMRT04TliKXivsrpUXzMzMh2WcUVeHIu3/RSrTYD9boDXkWDt1KC X-Received: by 10.98.111.65 with SMTP id k62mr10638299pfc.184.1521509025710; Mon, 19 Mar 2018 18:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521509025; cv=none; d=google.com; s=arc-20160816; b=m11ya3hrmuyxu4zTh6NpcKg8/XC7s5rX50/HOOdeGj+ZGiS5h2TPTL436wGdzoPbc2 CDAKeUFidC4JnfUBVVobNfWnTyQrqhc6HAEU+ShwaXQELQVF+osfH2V5uM2a8x6Rr9oK RbPDEvvBkf7Os/h4vtFiMcq3pbG4xjBFgQWNmWl16B7JUH+ttdoNG6zkFB5TVSNelZm/ Ts7hDZKbTQmhRnjF83bvMcOhN9jCbqW6xFxSShs8L42kMVkrV/a5TJUQG2QZEgKPPWw5 LGa4Ys5+0lr1EtirPhxg6+uHt/8CnWsCZa80BeZmjfN5x+sDgjYf0aabkWJPDyFKPB3E d0Zw== 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=4QHzFVY2NQqUl43oMM/vJmqtWaaXXzujAj7ObWgv1JE=; b=opU4MW9o4fuk7Ai/KvRSO8Bmz1WGob6uzDi6hrsdkQKeyuWyuCRcLjSvyhDf5ow4sj TBavX7CeXRU9M8L8tuPyEY3tdBj4xTgNVRcZpfAZ9BJHwKm21DEroeEF8yfba+xq2Aq8 QsoKGgpfqoJbPu6YZvGiUalk4qXWgxnyO4nSIkwqsNWV81GDwcTwhWF/ibj4ywoweGuG WCtHQY7lqiLhzdsqk9PyK6+ozzoYUVw2FzIqpIV9h7WVzpvlh2vpD39CcB6zLHItRBoO ct9Z3lPFCW8AY4KMWM2+jUFFhiLbIEDCp2eDe0VraOZSL3zNWUJN5Hdad5cZ7kaFDm3E yrhw== 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 b7-v6si434257plr.399.2018.03.19.18.23.31; Mon, 19 Mar 2018 18:23:45 -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 S935806AbeCSTKN (ORCPT + 99 others); Mon, 19 Mar 2018 15:10:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51348 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965746AbeCSS1o (ORCPT ); Mon, 19 Mar 2018 14:27:44 -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 3F31F126C; Mon, 19 Mar 2018 18:27:43 +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.9 183/241] power: supply: ab8500_charger: Bail out in case of error in ab8500_charger_init_hw_registers() Date: Mon, 19 Mar 2018 19:07:28 +0100 Message-Id: <20180319180758.722055266@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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,