]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/net/phy/mdio_bus.c: call put_device on device_register() failure
authorLevente Kurusa <levex@linux.com>
Fri, 3 Jan 2014 03:16:53 +0000 (14:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 6 Jan 2014 09:08:16 +0000 (20:08 +1100)
commitf3c2d7e8852d3a28c48e5717d3be41609c902c22
treefdc7446dd1adab2b9ad577906f14fcb51dca1c14
parentd6788e72ccadca98e28c3f4f9313d642fa27fcab
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: Levente Kurusa <levex@linux.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: David Daney <david.daney@cavium.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/net/phy/mdio_bus.c