migration: fix -Werror=maybe-uninitialized false-positive

../migration/ram.c:1873:23: error: ‘dirty’ may be used uninitialized [-Werror=maybe-uninitialized]

When 'block' != NULL, 'dirty' is initialized.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
Marc-André Lureau 2024-03-28 14:20:48 +04:00
parent 26a690c36e
commit 85f99eb2cb

View File

@ -1793,7 +1793,7 @@ static bool get_queued_page(RAMState *rs, PageSearchStatus *pss)
{
RAMBlock *block;
ram_addr_t offset;
bool dirty;
bool dirty = false;
do {
block = unqueue_page(rs, &offset);