Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8964c934 authored by Hou Tao's avatar Hou Tao Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit e7eea44eefbdd5f0345a0a8b80a3ca1c21030d06 ]

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>
parent f795a88e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -990,6 +990,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: