diff options
author | Pan Bian <bianpan2016@163.com> | 2021-01-20 04:20:37 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-22 19:15:55 -0800 |
commit | 0607a2cddb60f4548b55e28ac56a8d73493a45bb (patch) | |
tree | e5bb791b71a8f8c8d22a719b826bd800569998d3 /drivers/net/ethernet | |
parent | 3765d86ffcd346913c372d69cdc05dc8d56119ac (diff) | |
download | linux-0607a2cddb60f4548b55e28ac56a8d73493a45bb.tar.gz linux-0607a2cddb60f4548b55e28ac56a8d73493a45bb.tar.bz2 linux-0607a2cddb60f4548b55e28ac56a8d73493a45bb.zip |
net: fec: put child node on error path
Also decrement the reference count of child device on error path.
Fixes: 3e782985cb3c ("net: ethernet: fec: Allow configuration of MDIO bus speed")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/20210120122037.83897-1-bianpan2016@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 04f24c66cf36..55c28fbc5f9e 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2165,9 +2165,9 @@ static int fec_enet_mii_init(struct platform_device *pdev) fep->mii_bus->parent = &pdev->dev; err = of_mdiobus_register(fep->mii_bus, node); - of_node_put(node); if (err) goto err_out_free_mdiobus; + of_node_put(node); mii_cnt++; @@ -2180,6 +2180,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) err_out_free_mdiobus: mdiobus_free(fep->mii_bus); err_out: + of_node_put(node); return err; } |