Commit 709fe9c2 authored by Hou Tao's avatar Hou Tao Committed by Kelsey Skunberg

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

BugLink: https://bugs.launchpad.net/bugs/1887011

[ Upstream commit e7eea44e ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent c3488dd0
......@@ -757,6 +757,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