summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/fixed.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-01 07:27:46 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-01 07:27:46 -0400
commitb7a00ecd557859c4037b6465fdd6c9a49b1fa649 (patch)
treec3981f739ee2286ecb36054db52b24e690509060 /drivers/net/phy/fixed.c
parent1c7da74c4aab595a994beb5fe728ebf0d0b41f59 (diff)
[netdrvr] phy: Fix bugs in error handling
The recent __must_check stuff flagged some error handling bugs. phy/fixed.c: * handle device_bind_driver() failure phy/phy_device.c: * handle device_bind_driver() failure * release rwsem upon failure Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/phy/fixed.c')
-rw-r--r--drivers/net/phy/fixed.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 19f7ee63276..94b47c8d0ab 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -289,9 +289,13 @@ static int fixed_mdio_register_device(int number, int speed, int duplex)
goto probe_fail;
}
- device_bind_driver(&phydev->dev);
+ err = device_bind_driver(&phydev->dev);
+
up_write(&phydev->dev.bus->subsys.rwsem);
+ if (err)
+ goto probe_fail;
+
return 0;
probe_fail: