Commit 0c692d07 authored by Levente Kurusa's avatar Levente Kurusa Committed by Linus Torvalds
Browse files

drivers/net/phy/mdio_bus.c: call put_device on device_register() failure

It is required to call put_device() if device_register() fails, so that
we give up the last reference to the device.  Calling put_device allows
for mdiobus_release to be executed, kfreeing the bus.
Signed-off-by: default avatarLevente Kurusa <>
Cc: Greg Kroah-Hartman <>
Cc: Grant Likely <>
Cc: David Daney <>
Cc: David S. Miller <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 54f5968d
......@@ -150,6 +150,7 @@ int mdiobus_register(struct mii_bus *bus)
err = device_register(&bus->dev);
if (err) {
pr_err("mii_bus %s failed to register\n", bus->id);
return -EINVAL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment