Skip to content

Commit

Permalink
migration: Fix early failure cleanup
Browse files Browse the repository at this point in the history
Avoid crash in cleanup after a very early migration failure
(possibly due to my 688a3dc  'Route errors down ...')

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20180212160340.15333-2-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
  • Loading branch information
dagrh committed Feb 14, 2018
1 parent 17ca774 commit b9ccaf6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions migration/ram.c
Expand Up @@ -1602,11 +1602,13 @@ static void xbzrle_load_cleanup(void)

static void ram_state_cleanup(RAMState **rsp)
{
migration_page_queue_free(*rsp);
qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
g_free(*rsp);
*rsp = NULL;
if (*rsp) {
migration_page_queue_free(*rsp);
qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
g_free(*rsp);
*rsp = NULL;
}
}

static void xbzrle_cleanup(void)
Expand Down

0 comments on commit b9ccaf6

Please sign in to comment.