diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2022-03-16 11:26:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-23 11:16:42 +0300 |
commit | e396fda10ddfe9eaafbeebf78195eaf24ac7e49d (patch) | |
tree | 4aace2d668350152e0579a74123838cdb297f5aa /net/dsa | |
parent | 11dab4a800a4ffcceb805fd6bce33062669a3b5d (diff) | |
download | linux-e396fda10ddfe9eaafbeebf78195eaf24ac7e49d.tar.xz |
net: dsa: Add missing of_node_put() in dsa_port_parse_of
[ Upstream commit cb0b430b4e3acc88c85e0ad2e25f2a25a5765262 ]
The device_node pointer is returned by of_parse_phandle() with refcount
incremented. We should use of_node_put() on it when done.
Fixes: 6d4e5c570c2d ("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>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa2.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index e9911b18bdbf..e7fa8ce41a4c 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -1341,6 +1341,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn) const char *user_protocol; master = of_find_net_device_by_node(ethernet); + of_node_put(ethernet); if (!master) return -EPROBE_DEFER; |