]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Add missing of_node_put() in dsa_port_link_register_of
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 20 Apr 2022 11:04:08 +0000 (19:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Apr 2022 12:06:58 +0000 (13:06 +0100)
commit3038ead3076788352787ef9a7f8eea457cd44b5d
tree6182e526ddb90122a496c10e4b765c268f8f158a
parent664dfae007d1a053747a3e33fe52308e9eb849ef
net: dsa: Add missing of_node_put() in dsa_port_link_register_of

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

Fixes: 13d1c252508a ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/port.c