aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-10-01 02:29:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:32 -0400
commit6257b3bdfde4295c04872d710c2419ff8efc1b86 (patch)
tree443b1cb09a00eeeeef789af521d9a3c0adad9c79 /drivers
parentf4664132613caf40bfbf17b7e0ab3340a8b8f526 (diff)
[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: Amol Lad <amol@verismonetworks.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/ip22zilog.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 5ff269fb604c..dbf13c03a1bb 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -1229,13 +1229,27 @@ static int __init ip22zilog_init(void)
1229static void __exit ip22zilog_exit(void) 1229static void __exit ip22zilog_exit(void)
1230{ 1230{
1231 int i; 1231 int i;
1232 struct uart_ip22zilog_port *up;
1232 1233
1233 for (i = 0; i < NUM_CHANNELS; i++) { 1234 for (i = 0; i < NUM_CHANNELS; i++) {
1234 struct uart_ip22zilog_port *up = &ip22zilog_port_table[i]; 1235 up = &ip22zilog_port_table[i];
1235 1236
1236 uart_remove_one_port(&ip22zilog_reg, &up->port); 1237 uart_remove_one_port(&ip22zilog_reg, &up->port);
1237 } 1238 }
1238 1239
1240 /* Free IO mem */
1241 up = &ip22zilog_port_table[0];
1242 for (i = 0; i < NUM_IP22ZILOG; i++) {
1243 if (up[(i * 2) + 0].port.mapbase) {
1244 iounmap((void*)up[(i * 2) + 0].port.mapbase);
1245 up[(i * 2) + 0].port.mapbase = 0;
1246 }
1247 if (up[(i * 2) + 1].port.mapbase) {
1248 iounmap((void*)up[(i * 2) + 1].port.mapbase);
1249 up[(i * 2) + 1].port.mapbase = 0;
1250 }
1251 }
1252
1239 uart_unregister_driver(&ip22zilog_reg); 1253 uart_unregister_driver(&ip22zilog_reg);
1240} 1254}
1241 1255