PPC: Fix crash on spapr_tce_table_finalize()
commit5f9490de566c5b092a6cfedc3c7a37a9c9dee917
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 8 Dec 2014 02:48:02 +0000 (8 13:48 +1100)
committerAlexander Graf <agraf@suse.de>
Wed, 7 Jan 2015 15:16:26 +0000 (7 16:16 +0100)
tree84fb41f4c2ec9e0eb0b3186d8c5b7277279e9da7
parent77bad151fbd2b2eed1e959ecc2c3f2ee2f080f6c
PPC: Fix crash on spapr_tce_table_finalize()

spapr_tce_table_finalize() can SEGV if the object was not previously
realized.  In particular this can be triggered by running
         qemu-system-ppc -device spapr-tce-table,?

The basic problem is that we have mismatched initialization versus
finalization: spapr_tce_table_finalize() is attempting to undo things that
are done in spapr_tce_table_realize(), not an instance_init function.

Therefore, replace spapr_tce_table_finalize() with
spapr_tce_table_unrealize().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-stable@nongnu.org
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr_iommu.c