--- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -522,6 +522,7 @@ struct phy_device *phy_connect(struct ne phydev = to_phy_device(d); rc = phy_connect_direct(dev, phydev, handler, interface); + put_device(d); if (rc) return ERR_PTR(rc); @@ -721,6 +722,7 @@ struct phy_device *phy_attach(struct net phydev = to_phy_device(d); rc = phy_attach_direct(dev, phydev, phydev->dev_flags, interface); + put_device(d); if (rc) return ERR_PTR(rc);