From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH] libxc: only munmap when something has actually been mapped in change_pte Date: Sun, 29 Sep 2013 14:35:02 +1300 Message-ID: <1380418502-6591-1-git-send-email-mattjd@gmail.com> References: <1380109169.23688.109.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1380109169.23688.109.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Stefano Stabellini , Ian Jackson , Matthew Daley , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Coverity-ID: 1055269 Signed-off-by: Matthew Daley --- How's this? It's hard to create a very meaningful commit title here, IMO... tools/libxc/xc_offline_page.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c index fbb53f5..8195efb 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) ) -- 1.7.10.4