aboutsummaryrefslogtreecommitdiff
path: root/drivers/pcmcia/m8xx_pcmcia.c
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-10-20 14:44:18 -0700
committerDominik Brodowski <linux@dominikbrodowski.net>2006-10-25 21:59:43 -0400
commit3efa9970bd0ac731302224ab9243693e91bc4bea (patch)
treead915a88d7e7e027deeb989e25b387ced29f4d45 /drivers/pcmcia/m8xx_pcmcia.c
parenta230a6785dd5af84b8b043a64d8df8adc81f3724 (diff)
[PATCH] ioremap balanced with iounmap for drivers/pcmcia
ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Signed-off-by: Amol Lad <amol@verismonetworks.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/m8xx_pcmcia.c')
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index e070a289676..3b72be88040 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -427,7 +427,7 @@ static int voltage_set(int slot, int vcc, int vpp)
reg |= BCSR1_PCCVCC1;
break;
default:
- return 1;
+ goto out_unmap;
}
switch(vpp) {
@@ -438,15 +438,15 @@ static int voltage_set(int slot, int vcc, int vpp)
if(vcc == vpp)
reg |= BCSR1_PCCVPP1;
else
- return 1;
+ goto out_unmap;
break;
case 120:
if ((vcc == 33) || (vcc == 50))
reg |= BCSR1_PCCVPP0;
else
- return 1;
+ goto out_unmap;
default:
- return 1;
+ goto out_unmap;
}
/* first, turn off all power */
@@ -457,6 +457,10 @@ static int voltage_set(int slot, int vcc, int vpp)
iounmap(bcsr_io);
return 0;
+
+out_unmap:
+ iounmap(bcsr_io);
+ return 1;
}
#define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V