Commit cb0b430b authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Paolo Abeni

net: dsa: Add missing of_node_put() in dsa_port_parse_of

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

Fixes: 6d4e5c57 ("net: dsa: get port type at parse time")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220316082602.10785-1-linmq006@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4ee06de7
...@@ -1436,6 +1436,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn) ...@@ -1436,6 +1436,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
const char *user_protocol; const char *user_protocol;
master = of_find_net_device_by_node(ethernet); master = of_find_net_device_by_node(ethernet);
of_node_put(ethernet);
if (!master) if (!master)
return -EPROBE_DEFER; return -EPROBE_DEFER;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment