Message ID | 20081118143307.GA12255@xi.wantstofly.org |
---|---|
State | Superseded, archived |
Headers | show |
On Tue, Nov 18, 2008 at 03:33:07PM +0100, Lennert Buytenhek wrote: > Commit 46abc02175b3c246dd5141d878f565a8725060c9 ("phylib: give mdio > buses a device tree presence") added a call to device_unregister() in > a situation where the caller did not intend for the device to be > freed yet, but apart from just unregistering the device from the > system, device_unregister() does an additional put_device() that is > intended to free it. > > The right function to use in this situation is device_del(), which > unregisters the device from the system like device_unregister() does, > but without dropping the reference count an additional time. > > Bug report from Bryan Wu <cooloney@kernel.org>. Sorry, ignore this, it seems that you already merged this on friday. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 6671e2d..df06301 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -135,7 +135,7 @@ void mdiobus_unregister(struct mii_bus *bus) BUG_ON(bus->state != MDIOBUS_REGISTERED); bus->state = MDIOBUS_UNREGISTERED; - device_unregister(&bus->dev); + device_del(&bus->dev); for (i = 0; i < PHY_MAX_ADDR; i++) { if (bus->phy_map[i]) device_unregister(&bus->phy_map[i]->dev);