summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-09-30 23:29:24 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 00:39:32 -0700
commita141a04330bd6eadf7081a0860dc786be7d09c46 (patch)
treed493b835c4c204f55a96b556539743d708cb065b
parentbe618f550cb499db263e2ce22c5ad4f4dbfd53e6 (diff)
[PATCH] ioremap balanced with iounmap for drivers/serial/mpsc.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> Cc: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/serial/mpsc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index 63d2a66e563b..704243c9f78a 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -1893,6 +1893,10 @@ mpsc_drv_map_regs(struct mpsc_port_info *pi, struct platform_device *pd)
}
else {
mpsc_resource_err("SDMA base");
+ if (pi->mpsc_base) {
+ iounmap(pi->mpsc_base);
+ pi->mpsc_base = NULL;
+ }
return -ENOMEM;
}
@@ -1905,6 +1909,14 @@ mpsc_drv_map_regs(struct mpsc_port_info *pi, struct platform_device *pd)
}
else {
mpsc_resource_err("BRG base");
+ if (pi->mpsc_base) {
+ iounmap(pi->mpsc_base);
+ pi->mpsc_base = NULL;
+ }
+ if (pi->sdma_base) {
+ iounmap(pi->sdma_base);
+ pi->sdma_base = NULL;
+ }
return -ENOMEM;
}