Commit e7eea44e authored by Hou Tao's avatar Hou Tao Committed by Jens Axboe

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

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

Fixes: 6a27b656 ("block: virtio-blk: support multi virt queues per virtio-blk device")
Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3e20aa96
......@@ -878,6 +878,7 @@ static int virtblk_probe(struct virtio_device *vdev)
put_disk(vblk->disk);
out_free_vq:
vdev->config->del_vqs(vdev);
kfree(vblk->vqs);
out_free_vblk:
kfree(vblk);
out_free_index:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment