Skip to content
Snippets Groups Projects
Commit 72ae15d5 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Greg Kroah-Hartman
Browse files

net: dsa: Add missing of_node_put() in dsa_port_link_register_of


[ Upstream commit fc06b286 ]

The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.
of_node_put() will check for NULL value.

Fixes: a20f9970 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 14cc2044
No related branches found
No related tags found
2 merge requests!33Integrate changes of 5.10.116 version from ST,!29Bump to Release 5.10.114 and add/backport patches
......@@ -721,8 +721,10 @@ int dsa_port_link_register_of(struct dsa_port *dp)
if (ds->ops->phylink_mac_link_down)
ds->ops->phylink_mac_link_down(ds, port,
MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
of_node_put(phy_np);
return dsa_port_phylink_register(dp);
}
of_node_put(phy_np);
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment