Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3544197pxb; Mon, 1 Mar 2021 12:53:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+nGEwx5os3yKp9t/FiLnIGY1nxsEZqcfkSxbkkkQqm//jGrPVt1Y2bTMtP1m1AE91gDws X-Received: by 2002:a17:906:18aa:: with SMTP id c10mr17538769ejf.248.1614631997746; Mon, 01 Mar 2021 12:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614631997; cv=none; d=google.com; s=arc-20160816; b=GCimr6jGlfdlSTYmbsoX3P1LVwPEPEjHUnuroPqbbKIMnyvF+C2TVBW01FI/72kq2L HoRxzikI+4g5tzyfp2Iy0qhL0TVSo4HRRvj2PoyK+QDtm0Hu78LRircjEpA5oofflIJ5 +W39KIZ/dOnwiqJknLq9bVD8mluTVGopQixmcFoUVZGyRUUMN5p8/8c+8kooNv56R00S udAdk449tqTF61MuzRC/2VLp/cR8jawgeM+tV9O2SXapUtKvOuD+a2QQNCpgR9scQB+m Z0fQJ9JFKl0Xbl9Xc0jWuD4I4K1DF5plcZK449zTGQOgMLINdt7r+PqqrpMNuEJl2dDG c5Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mUYBsUB4nCFoniSQ3ZPClQ69qoIG8tdE6tRtx757OeQ=; b=BIGcfdnYmNnjqUMF7eeTSk9H2p8Rpt6gL/SzdGxUG5BYGxFguGXXZfIGPgixGzoZr7 CA0LwOzojzJbjeU89k2n7K0JtR8uebyYJp4v3aJhZNdeehSb+GQsowxE0IEbxW6Kj5I9 qZYQykoxnYefXmrw+qJ70qLrH0VezPHxjJFlaqbFfsU+7YAgoNelh7kpC9CH2wFXk2T6 a+q2cRpl3HjL4onbgZ/1jQHtXwJvBA3AqIfOhbx9IYS3fTN7ra/cHJl1BGsWGDixzk3v rAOZSPYeSuemWDRkrd/UrXD0n1r7RvMZlvF696kEoVR0vNDyx5lpac1HctC1YRGu4Fdf Y/zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pWpu6wCv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p88si12401916edp.145.2021.03.01.12.52.54; Mon, 01 Mar 2021 12:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pWpu6wCv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243704AbhCAUup (ORCPT + 99 others); Mon, 1 Mar 2021 15:50:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:36348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236160AbhCARJj (ORCPT ); Mon, 1 Mar 2021 12:09:39 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 810E765020; Mon, 1 Mar 2021 16:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616954; bh=r1RFw09sTKY+C71R7MQQO6UzZ+vEdnHHZSLR8RSblqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pWpu6wCvpRsf5AYPznnoJvUhWabFynJc3FMdeyO3ohYORBwR417+9KYR1LXGK119/ lETWwaKPrw+AtibpShEVA+n6q8xaXCzy+XOtPg7318TZYijYVVYslB5eK8zI9FbDJR FvDyvhY0bEUr0iaivklGRWBDGIVxp6BAAKuaV1ZM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Mark Brown , Sasha Levin Subject: [PATCH 4.19 125/247] regulator: axp20x: Fix reference cout leak Date: Mon, 1 Mar 2021 17:12:25 +0100 Message-Id: <20210301161037.791390489@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian [ Upstream commit e78bf6be7edaacb39778f3a89416caddfc6c6d70 ] Decrements the reference count of device node and its child node. Fixes: dfe7a1b058bb ("regulator: AXP20x: Add support for regulators subsystem") Signed-off-by: Pan Bian Link: https://lore.kernel.org/r/20210120123313.107640-1-bianpan2016@163.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/axp20x-regulator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index 91b8ff8bac157..c9e3677ac734b 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -558,7 +558,7 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) static int axp20x_regulator_parse_dt(struct platform_device *pdev) { struct device_node *np, *regulators; - int ret; + int ret = 0; u32 dcdcfreq = 0; np = of_node_get(pdev->dev.parent->of_node); @@ -573,13 +573,12 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev) ret = axp20x_set_dcdc_freq(pdev, dcdcfreq); if (ret < 0) { dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); - return ret; } - of_node_put(regulators); } - return 0; + of_node_put(np); + return ret; } static int axp20x_set_dcdc_workmode(struct regulator_dev *rdev, int id, u32 workmode) -- 2.27.0