All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] tools/libxc/xc_linux_osdep.c: Don't leak mmap() mapping on map_foreign_bulk() error path
@ 2015-03-16 10:06 PRAMOD DEVENDRA
  2015-03-17 15:45 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: PRAMOD DEVENDRA @ 2015-03-16 10:06 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Jackson, Wei Liu, Pramod Devendra, Ian Campbell, Stefano Stabellini

From: Pramod Devendra <pramod.devendra@citrix.com>

Signed-off-by: Pramod Devendra <pramod.devendra@citrix.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxc/xc_linux_osdep.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index b6c435a..ce59590 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -323,6 +323,7 @@ static void *linux_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h
             if ( pfn == MAP_FAILED )
             {
                 PERROR("xc_map_foreign_bulk: mmap of pfn array failed");
+                (void)munmap(addr, (unsigned long)num << XC_PAGE_SHIFT);
                 return NULL;
             }
         }
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-18 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 10:06 [PATCH 3/3] tools/libxc/xc_linux_osdep.c: Don't leak mmap() mapping on map_foreign_bulk() error path PRAMOD DEVENDRA
2015-03-17 15:45 ` Wei Liu
2015-03-18 12:32   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.