]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/fsl_pq_mdio.c
fsl_pq_mdio: Fix mdiobus allocation handling
[net-next-2.6.git] / drivers / net / fsl_pq_mdio.c
index 3acac5f930c8f7d3fd8563d46d046df94725673d..ff028f59b9306c086f03df626e5cecf31d131a22 100644 (file)
@@ -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,