diff options
author | Amol Lad <amol@verismonetworks.com> | 2006-10-20 17:44:18 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-10-25 21:59:43 -0400 |
commit | 3efa9970bd0ac731302224ab9243693e91bc4bea (patch) | |
tree | ad915a88d7e7e027deeb989e25b387ced29f4d45 /drivers/pcmcia/m8xx_pcmcia.c | |
parent | a230a6785dd5af84b8b043a64d8df8adc81f3724 (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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index e070a2896769..3b72be880401 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) | |||
427 | reg |= BCSR1_PCCVCC1; | 427 | reg |= BCSR1_PCCVCC1; |
428 | break; | 428 | break; |
429 | default: | 429 | default: |
430 | return 1; | 430 | goto out_unmap; |
431 | } | 431 | } |
432 | 432 | ||
433 | switch(vpp) { | 433 | switch(vpp) { |
@@ -438,15 +438,15 @@ static int voltage_set(int slot, int vcc, int vpp) | |||
438 | if(vcc == vpp) | 438 | if(vcc == vpp) |
439 | reg |= BCSR1_PCCVPP1; | 439 | reg |= BCSR1_PCCVPP1; |
440 | else | 440 | else |
441 | return 1; | 441 | goto out_unmap; |
442 | break; | 442 | break; |
443 | case 120: | 443 | case 120: |
444 | if ((vcc == 33) || (vcc == 50)) | 444 | if ((vcc == 33) || (vcc == 50)) |
445 | reg |= BCSR1_PCCVPP0; | 445 | reg |= BCSR1_PCCVPP0; |
446 | else | 446 | else |
447 | return 1; | 447 | goto out_unmap; |
448 | default: | 448 | default: |
449 | return 1; | 449 | goto out_unmap; |
450 | } | 450 | } |
451 | 451 | ||
452 | /* first, turn off all power */ | 452 | /* first, turn off all power */ |
@@ -457,6 +457,10 @@ static int voltage_set(int slot, int vcc, int vpp) | |||
457 | 457 | ||
458 | iounmap(bcsr_io); | 458 | iounmap(bcsr_io); |
459 | return 0; | 459 | return 0; |
460 | |||
461 | out_unmap: | ||
462 | iounmap(bcsr_io); | ||
463 | return 1; | ||
460 | } | 464 | } |
461 | 465 | ||
462 | #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V | 466 | #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V |