summaryrefslogtreecommitdiffstats
path: root/drivers/atm/eni.c
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2007-07-16 18:34:36 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-18 01:46:55 -0700
commit78e4be16e0563bb6bf25c178d1eb2f5f6f622eb2 (patch)
tree945679de12439e5b9a1efe8cc1a660ef81922e1e /drivers/atm/eni.c
parentde24a193124e40fc4f23160336982de1565d51fc (diff)
downloadlinux-78e4be16e0563bb6bf25c178d1eb2f5f6f622eb2.tar.bz2
[ATM]: [drivers] ioremap balanced with iounmap
Signed-off-by: Amol Lad <amol@verismonetworks.com> Signed-off-by: chas williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm/eni.c')
-rw-r--r--drivers/atm/eni.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 77637e780d41..41b2204ebc6e 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1738,7 +1738,8 @@ static int __devinit eni_do_init(struct atm_dev *dev)
printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad "
"magic - expected 0x%x, got 0x%x\n",dev->number,
ENI155_MAGIC,(unsigned) readl(&eprom->magic));
- return -EINVAL;
+ error = -EINVAL;
+ goto unmap;
}
}
eni_dev->phy = base+PHY_BASE;
@@ -1765,17 +1766,27 @@ static int __devinit eni_do_init(struct atm_dev *dev)
printk(")\n");
printk(KERN_ERR DEV_LABEL "(itf %d): ERROR - wrong id 0x%x\n",
dev->number,(unsigned) eni_in(MID_RES_ID_MCON));
- return -EINVAL;
+ error = -EINVAL;
+ goto unmap;
}
error = eni_dev->asic ? get_esi_asic(dev) : get_esi_fpga(dev,base);
- if (error) return error;
+ if (error)
+ goto unmap;
for (i = 0; i < ESI_LEN; i++)
printk("%s%02X",i ? "-" : "",dev->esi[i]);
printk(")\n");
printk(KERN_NOTICE DEV_LABEL "(itf %d): %s,%s\n",dev->number,
eni_in(MID_RES_ID_MCON) & 0x200 ? "ASIC" : "FPGA",
media_name[eni_in(MID_RES_ID_MCON) & DAUGTHER_ID]);
- return suni_init(dev);
+
+ error = suni_init(dev);
+ if (error)
+ goto unmap;
+out:
+ return error;
+unmap:
+ iounmap(base);
+ goto out;
}