aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-19 15:21:57 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-03-19 16:35:43 +0100
commiteb2fa76418402c8b26e1ab4cb53498ee0f4e52ef (patch)
tree84e8c079fae206e9c20051c8b8cc65fd360b8602
parentfd9307912d0a2ffa0310f9e20935d96d5af0a1ca (diff)
downloadqemu-arm-eb2fa76418402c8b26e1ab4cb53498ee0f4e52ef.tar.gz
virtio-scsi: call unregister_savevm properly
This fixes a use-after-free when migrating after hot-unplug. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--hw/virtio-scsi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index e607edc915..45d54faeb5 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -613,5 +613,7 @@ VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *proxyconf)
void virtio_scsi_exit(VirtIODevice *vdev)
{
+ VirtIOSCSI *s = (VirtIOSCSI *)vdev;
+ unregister_savevm(s->qdev, "virtio-scsi", s);
virtio_cleanup(vdev);
}