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>
        adapter->mdiobus->phy_mask = 0x0000001;
 
        retval = of_mdiobus_register(adapter->mdiobus, np);
+
+out:
        if (np)
                of_node_put(np);
-out:
 
        return retval;
 }