From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 930FEC43334 for ; Wed, 22 Jun 2022 08:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jl00GyFLlceTO2hSNJheS7DceSDqGg22+GeaHKrYTFs=; b=q4zddMr90X2vv1 xkI+PCUeVt4f9YVTPJsUL4d+iKdJ/NvBB7hYx1tfpL0dCu1khFfSvi6SI5KQotzzQ70cj3HpL1xNf YiK7MBA+L3842s7pO6b4UyksaEmDDC5gvNpmNDosJunuAW8rovoMn4ecfy+StkITMrn7ASfWUtkWb 9iBf8SvEotWorEzTNcVxu4fqEhLsa6U2cZhaJw2BjhgIgsPd3uimZVCMOYCGd5JLuzI+Byz2JhHaF +jKHUJ544+rAgF5vYihv0ahzq3iiXbXjFzQSubgenKu4aVnMtz/+3BDfnHWJ1CKhYIiT2lX7Z2KYv BsokpGn+uZCTe8IGj7zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3vLj-009AZZ-Fz; Wed, 22 Jun 2022 08:04:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3vLg-009AWb-6I for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 08:04:29 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7999313D5; Wed, 22 Jun 2022 01:04:15 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 74DA33F66F; Wed, 22 Jun 2022 01:04:14 -0700 (PDT) Date: Wed, 22 Jun 2022 09:04:08 +0100 From: Cristian Marussi To: Liang He Cc: sudeep.holla@arm.com, lgirdwood@gmail.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] regulator/scmi: Add missing of_node_get() Message-ID: References: <20220622034816.4094043-1-windhl@126.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220622034816.4094043-1-windhl@126.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_010428_319375_1A836C31 X-CRM114-Status: GOOD ( 17.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 22, 2022 at 11:48:16AM +0800, Liang He wrote: > In scmi_regulator_probe(), of_find_node_by_name() will decrease > the refcount of its first argument and we need a of_node_get() > to keep reference balance. > > Signed-off-by: Liang He Hi Liang, good catch. I saw many other drivers that had this same issue fixed, given it is not so obvious, had also added some explaining comment like: /* Balance of_node_put() done by of_find_node_by_name() */ so maybe it is a good idea to add something like that, but it depends at the end on how Mark prefers really. (given it is also in the commit log indeed...) Instead, more certainly, I would add also a Fixes: tag to you patch. Other than this: Reviewed-by: Cristian Marussi Thanks, Cristian > --- > drivers/regulator/scmi-regulator.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c > index 41ae7ac27ff6..b9918f4fd241 100644 > --- a/drivers/regulator/scmi-regulator.c > +++ b/drivers/regulator/scmi-regulator.c > @@ -343,6 +343,7 @@ static int scmi_regulator_probe(struct scmi_device *sdev) > * plausible SCMI Voltage Domain number, all belonging to this SCMI > * platform instance node (handle->dev->of_node). > */ > + of_node_get(handle->dev->of_node); > np = of_find_node_by_name(handle->dev->of_node, "regulators"); > for_each_child_of_node(np, child) { > ret = process_scmi_regulator_of_node(sdev, ph, child, rinfo); > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel