mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
net: dsa: Add missing of_node_put() in dsa_port_parse_of
[ Upstream commitcb0b430b4e
] The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes:6d4e5c570c
("net: dsa: get port type at parse time") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220316082602.10785-1-linmq006@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a630ad5e8b
commit
ba50073cf4
1 changed files with 1 additions and 0 deletions
|
@ -766,6 +766,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
|
|||
struct net_device *master;
|
||||
|
||||
master = of_find_net_device_by_node(ethernet);
|
||||
of_node_put(ethernet);
|
||||
if (!master)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
|
|
Loading…
Reference in a new issue