exec: fix early return from ram_block_add

After reporting an error, ram_block_add was going on with the registration
of the RAMBlock. The visible effect is that it unlocked the ramlist
mutex twice.

Backports commit 39c350ee12e733070e63d64a21bd42607366ea99 from qemu
This commit is contained in:
Paolo Bonzini 2018-02-21 21:37:52 -05:00 committed by Lioncash
parent 7775b05fb8
commit 9cf056404a
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1125,6 +1125,7 @@ static void ram_block_add(struct uc_struct *uc, RAMBlock *new_block, Error **err
error_setg_errno(errp, errno,
"cannot set up guest memory '%s'",
memory_region_name(new_block->mr));
return;
}
memory_try_enable_merging(new_block->host, new_block->max_length);
}