Patchwork [2/4] virtio-blk: Fix memleak on exit

login
register
mail settings
Submitter Amit Shah
Date July 27, 2011, 8:30 a.m.
Message ID <77ba08dc495de24dce9b3e410385ac19e3786cee.1311755243.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/106993/
State New
Headers show

Comments

Amit Shah - July 27, 2011, 8:30 a.m.
Calling virtio_cleanup() will free up memory allocated in
virtio_common_init().

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-blk.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Kevin Wolf - July 27, 2011, 9:07 a.m.
Am 27.07.2011 10:30, schrieb Amit Shah:
> Calling virtio_cleanup() will free up memory allocated in
> virtio_common_init().
> 
> Signed-off-by: Amit Shah <amit.shah@redhat.com>

Acked-by: Kevin Wolf <kwolf@redhat.com>

Patch

diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index 6471ac8..836dbc3 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -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);
 }