summaryrefslogtreecommitdiff
path: root/drivers/net/mdio/of_mdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mdio/of_mdio.c')
-rw-r--r--drivers/net/mdio/of_mdio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 796e9c7857d0..510822d6d0d9 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -68,8 +68,9 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,
/* All data is now stored in the mdiodev struct; register it. */
rc = mdio_device_register(mdiodev);
if (rc) {
+ device_set_node(&mdiodev->dev, NULL);
+ fwnode_handle_put(fwnode);
mdio_device_free(mdiodev);
- of_node_put(child);
return rc;
}