Skip to content

Commit

Permalink
virtio-blk: Fix memory leak among suspend/resume procedure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YongjiXie authored and mstsirkin committed Jul 3, 2021
1 parent 4232690 commit b71ba22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b71ba22

Please sign in to comment.