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 BA02AC43334 for ; Wed, 22 Jun 2022 08:24:17 +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:Message-ID:MIME-Version:References: In-Reply-To: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=2EKnOGQ4bI1cDze4Hlm29x7JjVID5lmLF32AOUuR2YI=; b=mo9CAWbeR4MFCE UfHp02sZ/aCyS9BoI8BS6n1n+Xg7tZ2zp50/c8t5uTRxGG9qAJfHCaD/uKI5hXzWpp/UDc4fXtrzX t1OTWiAGgnHmJcyv37ynLqi7VQl+0cTDxfG6hiriLXvnzYgyPWLl5LZFXUR5Ug5heu9dh2a6aw0kH 0nuPgH09cFXFv8/WPzmLZo3qqmCov/90/x3mR//UUfMmubnPq6xXkbf0vaZWOLD69LH1aPEHe5Gbj CGcEYc4AALUz5NV3RFTRLsEm21HCKTdoUC4kKRTLDTxl5CQpNtErmlsLl++pfst2opbmIKA6Z5KsQ hxhbVohLeR+RdWHprwTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3vdq-009ELq-Cj; Wed, 22 Jun 2022 08:23:14 +0000 Received: from m1550.mail.126.com ([220.181.15.50]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3vdm-009EKn-KP for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2022 08:23:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=VeWDC axr7rDCYW4AUkNNU5lRRnpU+1hFAAyROh/T4SQ=; b=QO9/xe02SH33Bp6bLhYWU WdbjHruaYVdmVBLxYf2CnTW/y3TDmx3O/bW3L9E7MB9ZD3nsYeHFZCMEULFJGXjU eaQ70ScG4jL2K9HnDna0kioIBmllao5Rkq9/+Avjfnn2x/RNXzcSyuo0w13kPNBT IMtv3i8NaJTcGImbRPN3B0= Received: from windhl$126.com ( [124.16.139.61] ) by ajax-webmail-wmsvr50 (Coremail) ; Wed, 22 Jun 2022 16:22:53 +0800 (CST) X-Originating-IP: [124.16.139.61] Date: Wed, 22 Jun 2022 16:22:53 +0800 (CST) From: "Liang He" To: "Cristian Marussi" Cc: sudeep.holla@arm.com, lgirdwood@gmail.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re:Re: [PATCH] regulator/scmi: Add missing of_node_get() X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT5.0.13 build 20220113(9671e152) Copyright (c) 2002-2022 www.mailtech.cn 126com In-Reply-To: References: <20220622034816.4094043-1-windhl@126.com> MIME-Version: 1.0 Message-ID: <7732c515.5bc8.1818a81d656.Coremail.windhl@126.com> X-Coremail-Locale: zh_CN X-CM-TRANSID: MsqowAAXbPBd0bJiDnY7AA--.36024W X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi2hUoF1uwMQmQgwACsy X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220622_012311_060618_2EEECD75 X-CRM114-Status: GOOD ( 12.54 ) 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 At 2022-06-22 16:04:08, "Cristian Marussi" wrote: >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. > Thanks. >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: > Thanks, Cristian. In fact, I know little aboult the rule of how to add 'Fixes: tag'. Can you tell me about that and I will certainly add 'Fixes: tag' in future. >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