From: Amol Lad Date: Sun, 1 Oct 2006 06:29:25 +0000 (-0700) Subject: [PATCH] ioremap balanced with iounmap for drivers/serial/sunsu.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=65da4d81f48e092f71feaf04bf2ccd096b5a5171;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [PATCH] ioremap balanced with iounmap for drivers/serial/sunsu.c ioremap must be balanced by an iounmap and failing to do so can result in a memory leak. Signed-off-by: Amol Lad Cc: Alan Cox Cc: David S. Miller Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index d3a5aeee73a3..9b3b9aaa6b90 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;