From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH for 4.6 v2 5/5] libxc: add assertion to avoid setting same bit more than once Date: Sat, 5 Sep 2015 00:59:27 +0100 Message-ID: <1441411167-32440-6-git-send-email-wei.liu2@citrix.com> References: <1441411167-32440-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZY0wi-00014k-A1 for xen-devel@lists.xenproject.org; Sat, 05 Sep 2015 00:03:04 +0000 In-Reply-To: <1441411167-32440-1-git-send-email-wei.liu2@citrix.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: Xen-devel Cc: Andrew Cooper , Ian Jackson , Ian Campbell , Wei Liu List-Id: xen-devel@lists.xenproject.org Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper --- tools/libxc/xc_sr_restore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c index 924dd55..f48e7fc 100644 --- a/tools/libxc/xc_sr_restore.c +++ b/tools/libxc/xc_sr_restore.c @@ -181,6 +181,7 @@ static int pfn_set_populated(struct xc_sr_context *ctx, xen_pfn_t pfn) ctx->restore.max_populated_pfn = new_max; } + assert(!test_bit(pfn, ctx->restore.populated_pfns)); set_bit(pfn, ctx->restore.populated_pfns); return 0; -- 2.1.4