Skip to contentSkip to conversation

xen/serial: Don't leak memory mapping if the serial initialization has failed

PATCH Superseded Julien Grall 2 participants 3 messages Feb 11, 2014 – Feb 19, 2014 Arm Samsung Exynos

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/serial: Don't leak memory mapping if the serial initialization has failed

---
 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(+)
xen/drivers/char/exynos4210-uart.c +1 -0
index 0619575..9a2b8b9 100644
@@ -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;
     }
 
xen/drivers/char/omap-uart.c +1 -0
index c1580ef..bfc39b4 100644
@@ -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;
     }
 
xen/drivers/char/pl011.c +1 -0
index fd82511..f7be578 100644
@@ -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;
     }
 
xen/include/asm-arm/mm.h +1 -0
index b8d4e7d..4211c0b 100644
@@ -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. */
Signature · 1 line
1.7.10.4