diff options
author | David S. Miller <davem@davemloft.net> | 2009-03-29 04:20:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-29 04:20:18 -0400 |
commit | 129dd9677b30a07bb832247dfe8d6089f1ac61a0 (patch) | |
tree | 6edba2e388d9020c23b11d77ea533040067cb143 /drivers/net/ucc_geth.c | |
parent | ee76db5e9e9896312f001790855a798472440328 (diff) |
ucc_geth: Fix use-after-of_node_put() in ucc_geth_probe().
We can't put 'mdio' until after we've used it in the
fsl_pq_mdio_bus_name() call.
Also fix error return values.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ucc_geth.c')
-rw-r--r-- | drivers/net/ucc_geth.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 86a479f61c0c..933fcfbf35e1 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3648,15 +3648,16 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3648 | mdio = of_get_parent(phy); | 3648 | mdio = of_get_parent(phy); |
3649 | 3649 | ||
3650 | if (mdio == NULL) | 3650 | if (mdio == NULL) |
3651 | return -1; | 3651 | return -ENODEV; |
3652 | 3652 | ||
3653 | err = of_address_to_resource(mdio, 0, &res); | 3653 | err = of_address_to_resource(mdio, 0, &res); |
3654 | of_node_put(mdio); | ||
3655 | |||
3656 | if (err) | ||
3657 | return -1; | ||
3658 | 3654 | ||
3655 | if (err) { | ||
3656 | of_node_put(mdio); | ||
3657 | return err; | ||
3658 | } | ||
3659 | fsl_pq_mdio_bus_name(bus_name, mdio); | 3659 | fsl_pq_mdio_bus_name(bus_name, mdio); |
3660 | of_node_put(mdio); | ||
3660 | snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), | 3661 | snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), |
3661 | "%s:%02x", bus_name, *prop); | 3662 | "%s:%02x", bus_name, *prop); |
3662 | } | 3663 | } |