diff options
author | Anton Vorontsov <avorontsov@mvista.com> | 2010-05-14 08:27:30 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-18 04:44:46 +0400 |
commit | 08d18f3b62b4c05731a09eca2b432842a0a18da5 (patch) | |
tree | 7225872a2ae55f67b8274ce6ede356a348b3b29b /drivers/net/fsl_pq_mdio.c | |
parent | a2f79227138c71e08627af5f8961197364edbc98 (diff) | |
download | linux-08d18f3b62b4c05731a09eca2b432842a0a18da5.tar.xz |
fsl_pq_mdio: Fix mdiobus allocation handling
The driver could return success code even if mdiobus_alloc() failed.
This patch fixes the issue.
Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fsl_pq_mdio.c')
-rw-r--r-- | drivers/net/fsl_pq_mdio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index 3acac5f930c8..ff028f59b930 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c @@ -277,15 +277,17 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev, int tbiaddr = -1; const u32 *addrp; u64 addr = 0, size = 0; - int err = 0; + int err; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; new_bus = mdiobus_alloc(); - if (NULL == new_bus) + if (!new_bus) { + err = -ENOMEM; goto err_free_priv; + } new_bus->name = "Freescale PowerQUICC MII Bus", new_bus->read = &fsl_pq_mdio_read, |