[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>
This commit is contained in:
parent
be618f550c
commit
a141a04330
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue