projects/linux·commit 65da4d81

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

65da4d81 · Amol Lad <[email protected]> · 2006-09-30 23:29:25 -07:00

ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.

Signed-off-by: Amol Lad <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: David S. Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
65da4d81f48e092f71feaf04bf2ccd096b5a5171
Parents
af907dc8

Changes

1 files changed · +3 −0

FileStatusAddDelContent
drivers/serial/sunsu.cmodified+3−0View file

drivers/serial/sunsu.c

View file
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index d3a5aee..9b3b9aa 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -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;