Skip to content

Commit

Permalink
[PATCH] ioremap balanced with iounmap for drivers/serial/sunsu.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: David S. Miller <davem@sunset.davemloft.net>
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 af907dc commit 65da4d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/serial/sunsu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,9 @@ static int __devexit su_remove(struct of_device *dev)
uart_remove_one_port(&sunsu_reg, &up->port);
}

if (up->port.membase)
of_iounmap(up->port.membase, up->reg_size);

dev_set_drvdata(&dev->dev, NULL);

return 0;
Expand Down

0 comments on commit 65da4d8

Please sign in to comment.