From: Marc MarĂ­ Date: Tue, 12 Aug 2014 11:41:49 +0000 (+0200) Subject: libqos: Correct mask to align size to PAGE_SIZE in malloc-pc X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f75ffc585717a26169d180a905aa1f4299aa57e7;p=qemu.git libqos: Correct mask to align size to PAGE_SIZE in malloc-pc Reviewed-by: John Snow Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Signed-off-by: Marc MarĂ­ Signed-off-by: Stefan Hajnoczi --- diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index 63af60ac17..be1d97f8bb 100644 --- a/tests/libqos/malloc-pc.c +++ b/tests/libqos/malloc-pc.c @@ -36,7 +36,7 @@ static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size) size += (PAGE_SIZE - 1); - size &= PAGE_SIZE; + size &= -PAGE_SIZE; g_assert_cmpint((s->start + size), <=, s->end);