From: Wei Liu Date: Sun, 6 Sep 2015 20:05:39 +0000 (+0100) Subject: libxc: add assertion to avoid setting same bit more than once X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2582 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a7b39c8bd6cba3fe1c8012987b9e28bdbac7e92d;p=xen.git libxc: add assertion to avoid setting same bit more than once Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper --- diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c index 924dd5534d..f48e7fcfe0 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;