ivshmem: Failed realize() can leave migration blocker behind
commitd855e2756554583b2b041c9e0a8381bdd202cbc3
authorMarkus Armbruster <armbru@redhat.com>
Tue, 15 Mar 2016 18:34:32 +0000 (15 19:34 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 21 Mar 2016 20:29:00 +0000 (21 21:29 +0100)
tree22ba6784d3247766be3bb1fd836fe39476c7f5c8
parent9cf70c52253ccadc137d40eb0de2c0f25a127334
ivshmem: Failed realize() can leave migration blocker behind

If pci_ivshmem_realize() fails after it created its migration blocker,
the blocker is left in place.  Fix that by creating it last.

Likewise, if it fails after it called fifo8_create(), it leaks fifo
memory.  Fix that the same way.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1458066895-20632-18-git-send-email-armbru@redhat.com>
hw/misc/ivshmem.c