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
[ Upstream commit b71ba22 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
YongjiXie authored and gregkh committed Jul 20, 2021
1 parent 1c8c1ad commit 29a2f4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/block/virtio_blk.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 29a2f4a

Please sign in to comment.