PPC: Fix crash on spapr_tce_table_finalize()
commitcb3360dbdd85ce2eb97805e4ce70932ab333e8d1
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 8 Dec 2014 02:48:02 +0000 (8 13:48 +1100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Sun, 22 Feb 2015 18:28:01 +0000 (22 12:28 -0600)
tree69592cd06703e2808c4bc3137df26fd3b8972c65
parentf738adeb5edef023fde0c47c3dce47987d7f6982
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>
(cherry picked from commit 5f9490de566c5b092a6cfedc3c7a37a9c9dee917)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr_iommu.c