Skip to content

Commit ba50073

Browse files
Yuuoniygregkh
authored andcommitted
net: dsa: Add missing of_node_put() in dsa_port_parse_of
[ Upstream commit cb0b430 ] The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 6d4e5c5 ("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>
1 parent a630ad5 commit ba50073

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/dsa/dsa2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
766766
struct net_device *master;
767767

768768
master = of_find_net_device_by_node(ethernet);
769+
of_node_put(ethernet);
769770
if (!master)
770771
return -EPROBE_DEFER;
771772

0 commit comments

Comments
 (0)