virtio-blk: Fix memleak on exit
authorAmit Shah <amit.shah@redhat.com>
Wed, 27 Jul 2011 08:30:30 +0000 (14:00 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 27 Jul 2011 17:08:19 +0000 (20:08 +0300)
Calling virtio_cleanup() will free up memory allocated in
virtio_common_init().

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio-blk.c

index 6471ac8..836dbc3 100644 (file)
@@ -594,4 +594,5 @@ void virtio_blk_exit(VirtIODevice *vdev)
 {
     VirtIOBlock *s = to_virtio_blk(vdev);
     unregister_savevm(s->qdev, "virtio-blk", s);
+    virtio_cleanup(vdev);
 }