From c827d7f39f7a184ed73e435237bbba54d4272bc1 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Sun, 29 Sep 2013 14:35:02 +1300 Subject: libxc: only munmap when something has actually been mapped in change_pte Coverity-ID: 1055269 signed-off-by: Matthew Daley Acked-by: Ian Campbell --- tools/libxc/xc_offline_page.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/libxc') diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c index fbb53f5f0f..8195efb952 100644 --- a/tools/libxc/xc_offline_page.c +++ b/tools/libxc/xc_offline_page.c @@ -317,10 +317,10 @@ static int change_pte(xc_interface *xch, int domid, goto failed; } } - } - munmap(content, PAGE_SIZE); - content = NULL; + munmap(content, PAGE_SIZE); + content = NULL; + } } if ( xc_flush_mmu_updates(xch, mmu) ) -- cgit v1.2.3