summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@bytedance.com>2021-05-17 16:43:32 +0800
committerMichael S. Tsirkin <mst@redhat.com>2021-07-03 04:50:52 -0400
commitb71ba22e7c6c6b279c66f53ee7818709774efa1f (patch)
treedfbdaf4310454bde7f0066dd9fc03ec923882684 /drivers/block
parent42326903c6324eca02ae3139e293a1aeb7540037 (diff)
virtio-blk: Fix memory leak among suspend/resume procedure
The vblk->vqs should be freed before we call init_vqs() in virtblk_restore(). Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Link: https://lore.kernel.org/r/20210517084332.280-1-xieyongji@bytedance.com Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 6dda64fec743..c3e260d5bdd0 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -929,6 +929,8 @@ static int virtblk_freeze(struct virtio_device *vdev)
blk_mq_quiesce_queue(vblk->disk->queue);
vdev->config->del_vqs(vdev);
+ kfree(vblk->vqs);
+
return 0;
}