Commit f4664132 authored by Amol Lad's avatar Amol Lad Committed by Linus Torvalds

[PATCH] ioremap balanced with iounmap for drivers/serial/ioc4_serial.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>
Cc: Brent Casavant <bcasavan@sgi.com>
Cc: Pat Gefre <pfg@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent d9964d5c
...@@ -2685,6 +2685,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd) ...@@ -2685,6 +2685,7 @@ static int ioc4_serial_remove_one(struct ioc4_driver_data *idd)
if (soft) { if (soft) {
free_irq(control->ic_irq, soft); free_irq(control->ic_irq, soft);
if (soft->is_ioc4_serial_addr) { if (soft->is_ioc4_serial_addr) {
iounmap(soft->is_ioc4_serial_addr);
release_region((unsigned long) release_region((unsigned long)
soft->is_ioc4_serial_addr, soft->is_ioc4_serial_addr,
sizeof(struct ioc4_serial)); sizeof(struct ioc4_serial));
...@@ -2887,6 +2888,8 @@ out4: ...@@ -2887,6 +2888,8 @@ out4:
out3: out3:
kfree(control); kfree(control);
out2: out2:
if (serial)
iounmap(serial);
release_region(tmp_addr1, sizeof(struct ioc4_serial)); release_region(tmp_addr1, sizeof(struct ioc4_serial));
out1: out1:
......
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