summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/engleder
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-11-24 09:40:48 +0100
committerJakub Kicinski <kuba@kernel.org>2021-11-26 04:20:34 +0100
commit739752d655b3a5fa6ea3d72c1b53cec082f86486 (patch)
tree16716f039cb49e2d24cc5ece9b41643f87d3fc47 /drivers/net/ethernet/engleder
parentveth: use ethtool_sprintf instead of snprintf (diff)
downloadlinux-739752d655b3a5fa6ea3d72c1b53cec082f86486.tar.xz
linux-739752d655b3a5fa6ea3d72c1b53cec082f86486.zip
tsnep: Add missing of_node_put() in tsnep_mdio_init()
The node pointer is returned by of_get_child_by_name() with refcount incremented in tsnep_mdio_init(). Calling of_node_put() to aovid the refcount leak in tsnep_mdio_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20211124084048.175456-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/engleder')
-rw-r--r--drivers/net/ethernet/engleder/tsnep_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c
index 955565a2a86c..904f3304727e 100644
--- a/drivers/net/ethernet/engleder/tsnep_main.c
+++ b/drivers/net/ethernet/engleder/tsnep_main.c
@@ -1089,9 +1089,10 @@ static int tsnep_mdio_init(struct tsnep_adapter *adapter)
adapter->mdiobus->phy_mask = 0x0000001;
retval = of_mdiobus_register(adapter->mdiobus, np);
+
+out:
if (np)
of_node_put(np);
-out:
return retval;
}