mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
net: fec: put child node on error path
Also decrement the reference count of child device on error path.
Fixes: 3e782985cb
("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>
This commit is contained in:
parent
3765d86ffc
commit
0607a2cddb
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue