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
OpenAnolis Bug Tracker: 0000311

commit b71ba22e7c6c6b279c66f53ee7818709774efa1f upstream.

The vblk->vqs should be freed before we call init_vqs()
in virtblk_restore().

Signed-off-by: Xie Yongji <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Jason Wang <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: hongnanli <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
  • Loading branch information
YongjiXie authored and hongnanli committed Oct 19, 2021
1 parent 26c8e3a commit 8dff4af
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 @@ -1052,6 +1052,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 8dff4af

Please sign in to comment.