Skip to content

Commit

Permalink
[PATCH] ioremap balanced with iounmap for drivers/serial/ioc4_serial.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amol Lad authored and Linus Torvalds committed Oct 1, 2006
1 parent d9964d5 commit f466413
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/serial/ioc4_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -2887,6 +2888,8 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
out3:
kfree(control);
out2:
if (serial)
iounmap(serial);
release_region(tmp_addr1, sizeof(struct ioc4_serial));
out1:

Expand Down

0 comments on commit f466413

Please sign in to comment.