Commit 6257b3bd authored by Amol Lad's avatar Amol Lad Committed by Linus Torvalds

[PATCH] ioremap balanced with iounmap for drivers/serial/ip22zilog.c

ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.
Signed-off-by: default avatarAmol Lad <amol@verismonetworks.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f4664132
...@@ -1229,13 +1229,27 @@ static int __init ip22zilog_init(void) ...@@ -1229,13 +1229,27 @@ static int __init ip22zilog_init(void)
static void __exit ip22zilog_exit(void) static void __exit ip22zilog_exit(void)
{ {
int i; int i;
struct uart_ip22zilog_port *up;
for (i = 0; i < NUM_CHANNELS; i++) { for (i = 0; i < NUM_CHANNELS; i++) {
struct uart_ip22zilog_port *up = &ip22zilog_port_table[i]; up = &ip22zilog_port_table[i];
uart_remove_one_port(&ip22zilog_reg, &up->port); uart_remove_one_port(&ip22zilog_reg, &up->port);
} }
/* Free IO mem */
up = &ip22zilog_port_table[0];
for (i = 0; i < NUM_IP22ZILOG; i++) {
if (up[(i * 2) + 0].port.mapbase) {
iounmap((void*)up[(i * 2) + 0].port.mapbase);
up[(i * 2) + 0].port.mapbase = 0;
}
if (up[(i * 2) + 1].port.mapbase) {
iounmap((void*)up[(i * 2) + 1].port.mapbase);
up[(i * 2) + 1].port.mapbase = 0;
}
}
uart_unregister_driver(&ip22zilog_reg); uart_unregister_driver(&ip22zilog_reg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment