[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH for-4.5] xen/serial: Don't leak memory mapping if the serial initialization has failed



Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
---
 xen/drivers/char/exynos4210-uart.c |    1 +
 xen/drivers/char/omap-uart.c       |    1 +
 xen/drivers/char/pl011.c           |    1 +
 xen/include/asm-arm/mm.h           |    1 +
 4 files changed, 4 insertions(+)

diff --git a/xen/drivers/char/exynos4210-uart.c 
b/xen/drivers/char/exynos4210-uart.c
index 0619575..9a2b8b9 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -344,6 +344,7 @@ static int __init exynos4210_uart_init(struct 
dt_device_node *dev,
     if ( res )
     {
         early_printk("exynos4210: Unable to retrieve the IRQ\n");
+        iounmap(uart->regs);
         return res;
     }
 
diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index c1580ef..bfc39b4 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -337,6 +337,7 @@ static int __init omap_uart_init(struct dt_device_node *dev,
     if ( res )
     {
         early_printk("omap-uart: Unable to retrieve the IRQ\n");
+        iounmap(uart->regs);
         return res;
     }
 
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index fd82511..f7be578 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -260,6 +260,7 @@ static int __init pl011_uart_init(struct dt_device_node 
*dev,
     if ( res )
     {
         early_printk("pl011: Unable to retrieve the IRQ\n");
+        iounmap(uart->regs);
         return res;
     }
 
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index b8d4e7d..4211c0b 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -4,6 +4,7 @@
 #include <xen/config.h>
 #include <xen/kernel.h>
 #include <asm/page.h>
+#include <xen/vmap.h>
 #include <public/xen.h>
 
 /* Align Xen to a 2 MiB boundary. */
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.