[PATCH] ioremap balanced with iounmap for drivers/serial/ioc4_serial.c
authorAmol Lad <amol@verismonetworks.com>
Sun, 1 Oct 2006 06:29:21 +0000 (23:29 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 1 Oct 2006 07:39:32 +0000 (00:39 -0700)
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>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Brent Casavant <bcasavan@sgi.com>
Cc: Pat Gefre <pfg@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/serial/ioc4_serial.c

index 576ca1e..5ec4716 100644 (file)
@@ -2685,6 +2685,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd)
        if (soft) {
                free_irq(control->ic_irq, soft);
                if (soft->is_ioc4_serial_addr) {
+                       iounmap(soft->is_ioc4_serial_addr);
                        release_region((unsigned long)
                             soft->is_ioc4_serial_addr,
                                sizeof(struct ioc4_serial));
@@ -2887,6 +2888,8 @@ out4:
 out3:
        kfree(control);
 out2:
+       if (serial)
+               iounmap(serial);
        release_region(tmp_addr1, sizeof(struct ioc4_serial));
 out1: