Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp445037iog; Mon, 13 Jun 2022 06:07:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDWLbThiBlwyLa4GunBNN9nHI7KdicRS4FgOeVRXJcukMgdsmg8RZoa63HRX9o4rbChZeP X-Received: by 2002:a17:902:7089:b0:168:b18e:9e15 with SMTP id z9-20020a170902708900b00168b18e9e15mr19627332plk.102.1655125555768; Mon, 13 Jun 2022 06:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125555; cv=none; d=google.com; s=arc-20160816; b=yMrHuzYzzyvrK8m3yjt0CQD/hFkQG+21xSOrYEtnpPgEVnPC6jXBa7rTJr0Wnomk9V nB2QE5dPf38hKHxzkcPwNQGNMb+MfUiHrHzq1BJ2tXtz+bG7Df9o2XLKrnXt5VCZUH2m gqjBMXJQWufVDn5w3WbagEgUkLQb9sKuZ2QfNTmX9Q90pH/bVclFIs60Kb8G1M4lScvq h0slZm2BXBXPsSFdxtXr4JS+p2odC0vXY28d67RL3Z89Y/Uvc31xlPwYMEjl8FuiZL/z n1HWTLyNNSjD/HOc1IQJdm9ASmYjQ8iDHr/6iXthKN4YPaPnsp/jcfJXMYz539IeOZ97 acOw== 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=liq2w3Y56hF6RGZfFCQGHx92eP/SjFHSDcLHqyrNlRA=; b=K0N/kFQS9eur2Evlp5BsOkbomT4fjvADpe/IO/qxCFUofPW0wALC+wob8Jqt1ZVG7a TVsQH86/LF66OZWrngjzqGI43tPPt0kJLY7QmtolKbsxB8vS1TodIXu4lHvKjkZVN+mS SChbHt/Q7wkCvncG1wkY9d1Tlv79ag4wbs5N4YCDvxQ+nSTDqHpKaK0Wqdt9CuLYoIDm OKZAQyoQhmBJKictR+hoHfipQKSY+cNhYjGaLuMsENCSTH+m+RVf98SW2A5hvkdi5/lJ ZMStF+Xm4uckUqmqRDfg0zlQPXTlJ3oFBKhZpEe45LNbTvvJKCitVYhfAezOSJgpbEZk jvAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="OAjBXu/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i22-20020a63cd16000000b003db97293633si9672080pgg.184.2022.06.13.06.05.39; Mon, 13 Jun 2022 06:05:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="OAjBXu/5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1353474AbiFMLTq (ORCPT + 99 others); Mon, 13 Jun 2022 07:19:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353386AbiFMLPg (ORCPT ); Mon, 13 Jun 2022 07:15:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAE7A37A9B; Mon, 13 Jun 2022 03:37:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F010A610A0; Mon, 13 Jun 2022 10:37:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A03DC34114; Mon, 13 Jun 2022 10:37:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116677; bh=bD3WJRYvtGNG7uTosFr26V1dTdZAK0QT563DMFOOOXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OAjBXu/56R//QbtNcqNbccrk6RULL8XMLwnaCziCT5QRRnaKv7o00JhV/4BUFo6rB G/YKE0dtagmDSG6nvb43sFVT8ahf1jXLQo89vMmJVhNPzbz9aXbrEW8yjQeYgC7DLr 7L2tDqk+7YG8AwyUjMFNI7/vIGItIfPVAFSoI1Ng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.4 133/411] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt Date: Mon, 13 Jun 2022 12:06:46 +0200 Message-Id: <20220613094932.660492818@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit afaa7b933ef00a2d3262f4d1252087613fb5c06d ] of_node_get() returns a node with refcount incremented. Calling of_node_put() to drop the reference when not needed anymore. Fixes: 3784b6d64dc5 ("regulator: pfuze100: add pfuze100 regulator driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220511113506.45185-1-linmq006@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/regulator/pfuze100-regulator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index 44b1da7cc374..f873d97100e2 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -528,6 +528,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip) parent = of_get_child_by_name(np, "regulators"); if (!parent) { dev_err(dev, "regulators node not found\n"); + of_node_put(np); return -EINVAL; } @@ -557,6 +558,7 @@ static int pfuze_parse_regulators_dt(struct pfuze_chip *chip) } of_node_put(parent); + of_node_put(np); if (ret < 0) { dev_err(dev, "Error parsing regulator init data: %d\n", ret); -- 2.35.1