From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH for 4.6 4/5] libxc: add assertion to avoid setting same bit more than once Date: Fri, 4 Sep 2015 19:32:10 +0100 Message-ID: <1441391531-30004-5-git-send-email-wei.liu2@citrix.com> References: <1441391531-30004-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZXvmg-0001GZ-1G for xen-devel@lists.xenproject.org; Fri, 04 Sep 2015 18:32:22 +0000 In-Reply-To: <1441391531-30004-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 --- 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 df885b6..adb48da 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