From patchwork Wed Feb 10 11:19:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harmandeep Kaur X-Patchwork-Id: 8270331 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9C690BEEE5 for ; Wed, 10 Feb 2016 11:22:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C680620373 for ; Wed, 10 Feb 2016 11:22:54 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07F55202D1 for ; Wed, 10 Feb 2016 11:22:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTSoe-0001Hs-0y; Wed, 10 Feb 2016 11:20:12 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTSod-0001Hh-1M for xen-devel@lists.xenproject.org; Wed, 10 Feb 2016 11:20:11 +0000 Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id 85/4A-28228-AEC1BB65; Wed, 10 Feb 2016 11:20:10 +0000 X-Env-Sender: write.harmandeep@gmail.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1455103207!22769556!1 X-Originating-IP: [209.85.192.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6058 invoked from network); 10 Feb 2016 11:20:08 -0000 Received: from mail-pf0-f195.google.com (HELO mail-pf0-f195.google.com) (209.85.192.195) by server-13.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 Feb 2016 11:20:08 -0000 Received: by mail-pf0-f195.google.com with SMTP id w128so243135pfb.2 for ; Wed, 10 Feb 2016 03:20:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=82ZT405nRe6pKp8BX4Xt9/+8/iaH58WaCwTg2pD9VPU=; b=QbMGoqADnWLroqnibtLcHejSkiSTjWon8HcZqGPAX1Y4/yMZ8eyCosAg1VgqdE793L wRaBgubgY/krlTFOf5KK4BD1zwVIsTnRlEpQi1Kiv5vSLmf3lzQHqZDA8M1QIR118fHF EtSQqkGquxeZm+MkflzZJvIBB29jZyP/C50fi1gTuw7dPv6n1j9Stnun1ObFXyktzwNK /atRqRlTphDrWvKFbCSVc22fn1ldihz0vpINSR4FXivbJ5g9pleuwTeDT2gceDulrwmt eg3YsoQyQCmGjrnEOzyxwGWaUDF8k4pxqxAgAZLA7rB73cqf+hwaU/hYz7m1DVNLIv6A ppzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=82ZT405nRe6pKp8BX4Xt9/+8/iaH58WaCwTg2pD9VPU=; b=Wvn1w+yj8KFRCPa8+pknZA9Jjjz/kTOdfby5lTcDWhRLHKTvagYRRlP03AGRTM9hHx 4ONvcIwUUHlrpHjQByjhvpz1/+yDOGZpW1g9M/0jpJcXFO8WmWFhnGAQq22xwULYe7cP qq86TR+NHW+mQ8rZ5v5HTJs5F4yyKUWhPWVr2nHfDeqnTPnAW/wgfYLZlo1TpUg1H1oG R+bU1NLINtgxjSDOZO3J46s0KOVt1KETdVJKRMO06B7n1dNpMof9FPNJTsyrEj3XI8jp /n/irLFEa94aBA9cmcOEMT4aPnOAVGZ4LWhBWV8FoCODFmFiGLZik/eT8uBsv7O1NWrd 5GUA== X-Gm-Message-State: AG10YORLgmJn/dQs/4z2supZ6Ts2YRlD8t9HIIsjTLlFxG18L5EHzgP29jO2y6XCfEllqA== X-Received: by 10.98.14.69 with SMTP id w66mr58008492pfi.144.1455103207201; Wed, 10 Feb 2016 03:20:07 -0800 (PST) Received: from localhost.localdomain ([27.255.251.238]) by smtp.googlemail.com with ESMTPSA id 79sm4497499pfr.22.2016.02.10.03.20.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 03:20:06 -0800 (PST) From: Harmandeep Kaur To: xen-devel@lists.xenproject.org Date: Wed, 10 Feb 2016 16:49:38 +0530 Message-Id: <1455103178-3959-1-git-send-email-write.harmandeep@gmail.com> X-Mailer: git-send-email 2.5.0 Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, Harmandeep Kaur Subject: [Xen-devel] [PATCH v2] libxc: fix leak in xc_offline_page error path X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid leaking the mapping of the m2p in one of the possible failure cases. Coverity CID 1351225 Signed-off-by: Harmandeep Kaur Acked-by: Ian Jackson --- v2: update commit message and changelog --- tools/libxc/xc_offline_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c index bc91d51..3248a34 100644 --- a/tools/libxc/xc_offline_page.c +++ b/tools/libxc/xc_offline_page.c @@ -504,7 +504,7 @@ int xc_exchange_page(xc_interface *xch, int domid, xen_pfn_t mfn) if ( xc_map_domain_meminfo(xch, domid, &minfo) ) { PERROR("Could not map domain's memory information\n"); - return -1; + goto failed; } /* For translation macros */