summaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-03-16 09:26:02 +0100
committerPaolo Abeni <pabeni@redhat.com>2022-03-17 13:13:27 +0100
commitcb0b430b4e3acc88c85e0ad2e25f2a25a5765262 (patch)
tree86e2f95358eafd628bf2895594859f549f1352e9 /net/dsa/dsa2.c
parentnet: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() (diff)
downloadlinux-cb0b430b4e3acc88c85e0ad2e25f2a25a5765262.tar.xz
linux-cb0b430b4e3acc88c85e0ad2e25f2a25a5765262.zip
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: 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>
Diffstat (limited to '')
-rw-r--r--net/dsa/dsa2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 074e4a69a728..88e2808019b4 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -1436,6 +1436,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;