From: Scott Wood Date: Fri, 2 May 2008 18:42:41 +0000 (-0500) Subject: fs_enet: Fix a memory leak in fs_enet_mdio_probe X-Git-Tag: v2.6.26-rc2~23^2~2^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a86e2cbe263c193a70b2e5c5a0c7e53ed39fc0ad;p=linux-2.6 fs_enet: Fix a memory leak in fs_enet_mdio_probe There are more memory leaks in the !PPC_CPM_NEW_BINDING case, but that code will disappear soon along with arch/ppc. Reported by Daniel Marjamki at http://bugzilla.kernel.org/show_bug.cgi?id=10591 Signed-off-by: Scott Wood Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c index ba75efc9f5..f0014cfbb2 100644 --- a/drivers/net/fs_enet/mii-fec.c +++ b/drivers/net/fs_enet/mii-fec.c @@ -194,7 +194,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, ret = of_address_to_resource(ofdev->node, 0, &res); if (ret) - return ret; + goto out_res; snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); @@ -236,6 +236,7 @@ out_free_irqs: kfree(new_bus->irq); out_unmap_regs: iounmap(fec->fecp); +out_res: out_fec: kfree(fec); out_mii: