lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250207013117.104205-7-zhangzekun11@huawei.com>
Date: Fri, 7 Feb 2025 09:31:14 +0800
From: Zhang Zekun <zhangzekun11@...wei.com>
To: <robh@...nel.org>, <saravanak@...gle.com>, <justin.chen@...adcom.com>,
	<florian.fainelli@...adcom.com>, <andrew+netdev@...n.ch>, <kuba@...nel.org>,
	<o.rempel@...gutronix.de>, <kory.maincent@...tlin.com>,
	<jacopo+renesas@...ndi.org>, <kieran.bingham+renesas@...asonboard.com>,
	<laurent.pinchart+renesas@...asonboard.com>, <maddy@...ux.ibm.com>,
	<mpe@...erman.id.au>, <npiggin@...il.com>, <olteanv@...il.com>,
	<davem@...emloft.net>, <taras.chornyi@...ision.eu>, <edumazet@...gle.com>,
	<pabeni@...hat.com>, <sudeep.holla@....com>, <cristian.marussi@....com>
CC: <arm-scmi@...r.kernel.org>, <linuxppc-dev@...ts.ozlabs.org>,
	<linux-media@...r.kernel.org>, <netdev@...r.kernel.org>,
	<devicetree@...r.kernel.org>, <chenjun102@...wei.com>,
	<zhangzekun11@...wei.com>
Subject: [PATCH 6/9] net: dsa: Use of_find_node_by_name_balanced() to find device_node

Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.

Signed-off-by: Zhang Zekun <zhangzekun11@...wei.com>
---
 drivers/net/dsa/bcm_sf2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index fa2bf3fa9019..7567686317f1 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1435,9 +1435,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
 	set_bit(0, priv->cfp.used);
 	set_bit(0, priv->cfp.unique);
 
-	/* Balance of_node_put() done by of_find_node_by_name() */
-	of_node_get(dn);
-	ports = of_find_node_by_name(dn, "ports");
+	ports = of_find_node_by_name_balanced(dn, "ports");
 	if (ports) {
 		bcm_sf2_identify_ports(priv, ports);
 		of_node_put(ports);
-- 
2.22.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ