aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/mpsc.c
diff options
context:
space:
mode:
authorAmol Lad <amol@verismonetworks.com>2006-10-01 02:29:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:32 -0400
commita141a04330bd6eadf7081a0860dc786be7d09c46 (patch)
treed493b835c4c204f55a96b556539743d708cb065b /drivers/serial/mpsc.c
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>
Diffstat (limited to 'drivers/serial/mpsc.c')
-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)
1893 } 1893 }
1894 else { 1894 else {
1895 mpsc_resource_err("SDMA base"); 1895 mpsc_resource_err("SDMA base");
1896 if (pi->mpsc_base) {
1897 iounmap(pi->mpsc_base);
1898 pi->mpsc_base = NULL;
1899 }
1896 return -ENOMEM; 1900 return -ENOMEM;
1897 } 1901 }
1898 1902
@@ -1905,6 +1909,14 @@ mpsc_drv_map_regs(struct mpsc_port_info *pi, struct platform_device *pd)
1905 } 1909 }
1906 else { 1910 else {
1907 mpsc_resource_err("BRG base"); 1911 mpsc_resource_err("BRG base");
1912 if (pi->mpsc_base) {
1913 iounmap(pi->mpsc_base);
1914 pi->mpsc_base = NULL;
1915 }
1916 if (pi->sdma_base) {
1917 iounmap(pi->sdma_base);
1918 pi->sdma_base = NULL;
1919 }
1908 return -ENOMEM; 1920 return -ENOMEM;
1909 } 1921 }
1910 1922