Sasha Levin
2021-Jul-10 23:49 UTC
[PATCH AUTOSEL 5.12 39/43] virtio-blk: Fix memory leak among suspend/resume procedure
From: Xie Yongji <xieyongji at bytedance.com> [ Upstream commit b71ba22e7c6c6b279c66f53ee7818709774efa1f ] The vblk->vqs should be freed before we call init_vqs() in virtblk_restore(). Signed-off-by: Xie Yongji <xieyongji at bytedance.com> Link: https://lore.kernel.org/r/20210517084332.280-1-xieyongji at bytedance.com Acked-by: Jason Wang <jasowang at redhat.com> Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/block/virtio_blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index b9fa3ef5b57c..425bae618131 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -948,6 +948,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; } -- 2.30.2