Received: by 10.213.65.68 with SMTP id h4csp470557imn; Fri, 16 Mar 2018 08:44:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELuRxg2XYRkbmYxKRhP3JypHlChXKVtJXf99K2q87UaQeEZk4U3X/BEssuHRwjvj8vBRO7FG X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr2646456plo.6.1521215095230; Fri, 16 Mar 2018 08:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521215095; cv=none; d=google.com; s=arc-20160816; b=ZqqQu0bi+wR3j+O2QEGUHhknyIYQ6iiafU4FYkUlAwtsuFbRGrbYWhaugKCL0uly3w r9p102Eal/Ef+LmJ3QyDZDRAVMQ3c+T+fJjQpAIGwYaK+ksth/hvKY4Z4BQPLULKie41 AB7yv0G77pTOcVAfWsWL0CcSNARzC7wS2OYobBpMqFrulIzwGDZfqj7JY1PoyxOhz8PY GgX26GnQBtu4TDDMG8bFH+YSkCWqXoHtzc+x91bAVTAX5xHJEr/5WqcMMNc9mJNLwASB Ka/r28TjZ0nYmhIg6Gx6J1SvzWLbIUEYkok06od+PYJn9vQMEcDrWwehMzGthBTQ0TE2 dr8w== 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=JfM1zW7m2Ie126FqldR6xJlRe9zRTUX6GIbMLpCq1ik=; b=bYMXUI1KLalVvX+A2UCT2M7ooiwa0hhhrdPXYAYnRyLzaJ3sNt6dePKqi+9RxuLSZk 7EbsnJtSN+02NTA8+lTZPPJdZGuz3ep0Xp5TxO45+vVOfb/Y6ywW17DRxR7ZpXwtZ6Uo u88YlD7n9Wpod04ronUteF5Lw1avsc9KzhvAlpSovCoY6nYQ9uWr3SYt1ZUiyC7GZpj+ mwhXNIPLMLrn/q2v+Gv4qyKfWPU7XolGU3LIN5NcGMcsgSFTxgLgiZRXVsrHlOKSnkPQ Ovwwe5/sUuarxyjiozrkK67R+O+Jj/dMeO9VqzXBy7nfAKOGrKAfOaE5RVHbAeBz+pig tQKQ== 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 y16si73710pge.500.2018.03.16.08.44.40; Fri, 16 Mar 2018 08:44:55 -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 S1754904AbeCPPm0 (ORCPT + 99 others); Fri, 16 Mar 2018 11:42:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44456 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754849AbeCPPmX (ORCPT ); Fri, 16 Mar 2018 11:42:23 -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 89526FC5; Fri, 16 Mar 2018 15:42:22 +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.15 071/128] power: supply: ab8500_charger: Bail out in case of error in ab8500_charger_init_hw_registers() Date: Fri, 16 Mar 2018 16:23:32 +0100 Message-Id: <20180316152340.254833015@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-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,