mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
migration: Unlock mutex in error case
We were not unlocking bitmap mutex on the error case. To fix it
forever change to enclose the code with WITH_QEMU_LOCK_GUARD().
Coverity CID 1523750.
Fixes: a2326705e5
("migration: Stop migration immediately in RDMA error paths")
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231103074245.55166-1-quintela@redhat.com>
This commit is contained in:
parent
ceddc48278
commit
0983125b40
1 changed files with 55 additions and 55 deletions
|
@ -3030,7 +3030,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
|
|||
* MAX_WAIT (if curious, further see commit 4508bd9ed8053ce) below, which
|
||||
* guarantees that we'll at least released it in a regular basis.
|
||||
*/
|
||||
qemu_mutex_lock(&rs->bitmap_mutex);
|
||||
WITH_QEMU_LOCK_GUARD(&rs->bitmap_mutex) {
|
||||
WITH_RCU_READ_LOCK_GUARD() {
|
||||
if (ram_list.version != rs->last_version) {
|
||||
ram_state_reset(rs);
|
||||
|
@ -3094,7 +3094,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
|
|||
i++;
|
||||
}
|
||||
}
|
||||
qemu_mutex_unlock(&rs->bitmap_mutex);
|
||||
}
|
||||
|
||||
/*
|
||||
* Must occur before EOS (or any QEMUFile operation)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue