mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-06 11:09:37 +00:00
migration: process_incoming_migration_co(): fix reporting s->error
It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
246f54e0cc
commit
30116e9079
|
@ -784,6 +784,7 @@ process_incoming_migration_co(void *opaque)
|
|||
if (migrate_has_error(s)) {
|
||||
WITH_QEMU_LOCK_GUARD(&s->error_mutex) {
|
||||
error_report_err(s->error);
|
||||
s->error = NULL;
|
||||
}
|
||||
}
|
||||
error_report("load of migration failed: %s", strerror(-ret));
|
||||
|
|
Loading…
Reference in a new issue