Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2142269iof; Tue, 7 Jun 2022 21:09:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSXaHgJfCckM916b8nFr8sl/bV7kUOgqDas23zAkW6OFgD6FQbfHzJlWaFnIG88U2zMcKf X-Received: by 2002:a63:90c9:0:b0:3fc:f0c9:d0f with SMTP id a192-20020a6390c9000000b003fcf0c90d0fmr25332203pge.608.1654661381347; Tue, 07 Jun 2022 21:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661381; cv=none; d=google.com; s=arc-20160816; b=Z8T84932KJjcojg2DGI2Vt2sWoPi58oGRcyJ65HC2LbPkTvsLl/EMD1vNuK0J50Gxu hkGrZXgVcadzy0WwUSDC/kny47G4UooaIFLwasZ+HMp7U8YgN1B2vgFvMwDvztQlFmm3 liBJf0VAxmTpERmCqs1zLUtv8GThXv1gSJ7hV6KD/ffXjT0aiK90jZjxK7EKCBvOLvh5 7RTArJ8D6/lLwgPaXoJJ0j01kGLHrLjhNiB5CAehQG+q8ixEf9C0HWkXv4d78OXScZuc cfvbVFo+TZ2DmG232eIKK0AvKvUAVXZOKIwNcIkAwxx2SNSljLJP9S2yYiTfW/+j8TEA 6ubQ== 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=HHO9F1XxiAH1ltZ+XYBmtNruWfhcnKi38GOl+Q5feQk=; b=ZiA+/UXSRcecZqa5x9P94RNqzxNtPCM+qJAYjoRCrjWH0UUd3auv5vIywBw83AnaTA mgjH5ST0RC2eMgGg31F0Q2EkehOhnDw/QkAesR1iTsSA3hEseOejbzPfkdfL7Qfh7XZ9 q5+XH+zjOeLa2OnH/d3PgsyQFgkhJN/e3Jmcwsq/zFI+JVMcIO43hP2gNrPUKMHoH4MK DQQV17KGNQP4RJOOdxiE2l35iIOmb5T+IeqoA6U18z+2cAoamwKvLK823Q0bWtUfc35w QlI84QwqmjxJTk5zoVclOWCidzk0TQDun4JgSGg/G+Qr9BEaQwcW+hJSIA1RaDX2sAzA fBaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QP0Q5tvI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p20-20020a170903249400b0016401138e2esi23786892plw.48.2022.06.07.21.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:09:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QP0Q5tvI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7D85DD4126; Tue, 7 Jun 2022 20:41:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348148AbiFGRo7 (ORCPT + 99 others); Tue, 7 Jun 2022 13:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348121AbiFGRbe (ORCPT ); Tue, 7 Jun 2022 13:31:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B3BB1157EB; Tue, 7 Jun 2022 10:29:22 -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 E7848614B2; Tue, 7 Jun 2022 17:29:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04BD4C385A5; Tue, 7 Jun 2022 17:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622961; bh=GatijN55k1AA0GMg1EH5nn4U3eGNXjfP0pjE9uIJV5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QP0Q5tvIaxjC0afR9vt25bqrqfRxtf5Pr0eGHWORWBKK7G+a+CF5ZpwsLgRuU3Xws DyCbv1SGS9di4a6XQUpIUYIUx5TSEys78a7CwZH6r20EsKkW65lOXrkPJNOW2FFbtp xNjCRZumRzoAPleS1n+pQXzn2lO9s9ALGAO9kMFQ= 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.10 204/452] regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt Date: Tue, 7 Jun 2022 19:01:01 +0200 Message-Id: <20220607164914.642448840@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 01a12cfcea7c..0a19500d3725 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -531,6 +531,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; } @@ -560,6 +561,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