|
@@ -137,8 +137,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
|
|
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
|
|
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
|
|
|
|
|
|
fec->fecp = ioremap(res.start, resource_size(&res));
|
|
fec->fecp = ioremap(res.start, resource_size(&res));
|
|
- if (!fec->fecp)
|
|
|
|
|
|
+ if (!fec->fecp) {
|
|
|
|
+ ret = -ENOMEM;
|
|
goto out_fec;
|
|
goto out_fec;
|
|
|
|
+ }
|
|
|
|
|
|
if (get_bus_freq) {
|
|
if (get_bus_freq) {
|
|
clock = get_bus_freq(ofdev->dev.of_node);
|
|
clock = get_bus_freq(ofdev->dev.of_node);
|
|
@@ -172,8 +174,10 @@ static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
|
|
|
|
|
|
new_bus->phy_mask = ~0;
|
|
new_bus->phy_mask = ~0;
|
|
new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
|
|
new_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
|
|
- if (!new_bus->irq)
|
|
|
|
|
|
+ if (!new_bus->irq) {
|
|
|
|
+ ret = -ENOMEM;
|
|
goto out_unmap_regs;
|
|
goto out_unmap_regs;
|
|
|
|
+ }
|
|
|
|
|
|
new_bus->parent = &ofdev->dev;
|
|
new_bus->parent = &ofdev->dev;
|
|
dev_set_drvdata(&ofdev->dev, new_bus);
|
|
dev_set_drvdata(&ofdev->dev, new_bus);
|