summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Hongfei <luhongfei@vivo.com>2023-07-10 06:18:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-23 14:53:47 +0300
commit7ead10b44b79ce8bfcd51e749d54e009de5f511a (patch)
tree0d0117d9f63e9ebbe14bba8edf735d178a2420d8
parenteeab8f95bae291ef48aaa004ee4385d6e2d040b0 (diff)
downloadlinux-7ead10b44b79ce8bfcd51e749d54e009de5f511a.tar.xz
net: dsa: Removed unneeded of_node_put in felix_parse_ports_node
[ Upstream commit 04499f28b40bfc24f20b0e2331008bb90a54a6cf ] Remove unnecessary of_node_put from the continue path to prevent child node from being released twice, which could avoid resource leak or other unexpected issues. Signed-off-by: Lu Hongfei <luhongfei@vivo.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Fixes: de879a016a94 ("net: dsa: felix: add functionality when not all ports are supported") Link: https://lore.kernel.org/r/20230710031859.36784-1-luhongfei@vivo.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/dsa/ocelot/felix.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 8348da2b3c97..d78b4bd4787e 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1286,7 +1286,6 @@ static int felix_parse_ports_node(struct felix *felix,
if (err < 0) {
dev_info(dev, "Unsupported PHY mode %s on port %d\n",
phy_modes(phy_mode), port);
- of_node_put(child);
/* Leave port_phy_modes[port] = 0, which is also
* PHY_INTERFACE_MODE_NA. This will perform a