xen/serial: Don't leak memory mapping if the serial initialization has failed
PATCH 1/1 xen/serial: Don't leak memory mapping if the serial initialization has failed
Signed-off-by Julien Grall <[email protected]>
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
Quoted 1 line · Julien Grall
Signed-off-by Julien Grall <[email protected]>
Acked-by Ian Campbell <[email protected]>
Although you could also consider moving the dt_device_get_irq before the ioremap_attr in most cases.
Hi Ian,
Quoted 7 lines · Ian Campbell
Quoted 1 line · Julien Grall
Signed-off-by Julien Grall <[email protected]>Acked-by Ian Campbell <[email protected]>Although you could also consider moving the
dt_device_get_irqbefore theioremap_attrin most cases.
I will use this solution.
Cheers,
Signature · 1 line
Julien Grall