xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: stefano.stabellini@citrix.com,
	Julien Grall <julien.grall@linaro.org>,
	tim@xen.org, ian.campbell@citrix.com
Subject: [PATCH for-4.5] xen/serial: Don't leak memory mapping if the serial initialization has failed
Date: Tue, 11 Feb 2014 21:27:30 +0000	[thread overview]
Message-ID: <1392154050-21649-1-git-send-email-julien.grall@linaro.org> (raw)

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 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

             reply	other threads:[~2014-02-11 21:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 21:27 Julien Grall [this message]
2014-02-19 12:21 ` [PATCH for-4.5] xen/serial: Don't leak memory mapping if the serial initialization has failed Ian Campbell
2014-02-19 17:46   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392154050-21649-1-git-send-email-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).