virtio-blk: free vblk-vqs in error path of virtblk_probe()

[ Upstream commit e7eea44eef ]

Else there will be memory leak if alloc_disk() fails.

Fixes: 6a27b656fc ("block: virtio-blk: support multi virt queues per virtio-blk device")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Hou Tao 2020-06-15 12:14:59 +08:00 committed by Greg Kroah-Hartman
parent f795a88ead
commit 8964c93436
1 changed files with 1 additions and 0 deletions

View File

@ -990,6 +990,7 @@ out_put_disk:
put_disk(vblk->disk);
out_free_vq:
vdev->config->del_vqs(vdev);
kfree(vblk->vqs);
out_free_vblk:
kfree(vblk);
out_free_index: