aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/82xx
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/82xx')
-rw-r--r--arch/powerpc/platforms/82xx/ep8248e.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index 51fcae41f08a..f9aee182e6f7 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -132,12 +132,25 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
132 return -ENOMEM; 132 return -ENOMEM;
133 133
134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); 134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
135 if (bus->irq == NULL) {
136 ret = -ENOMEM;
137 goto err_free_bus;
138 }
135 139
136 bus->name = "ep8248e-mdio-bitbang"; 140 bus->name = "ep8248e-mdio-bitbang";
137 bus->parent = &ofdev->dev; 141 bus->parent = &ofdev->dev;
138 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); 142 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
139 143
140 return of_mdiobus_register(bus, ofdev->node); 144 ret = of_mdiobus_register(bus, ofdev->node);
145 if (ret)
146 goto err_free_irq;
147
148 return 0;
149err_free_irq:
150 kfree(bus->irq);
151err_free_bus:
152 free_mdio_bitbang(bus);
153 return ret;
141} 154}
142 155
143static int ep8248e_mdio_remove(struct of_device *ofdev) 156static int ep8248e_mdio_remove(struct of_device *ofdev)