Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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

Fixes: 6a27b656fc02 ("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>

authored by

Hou Tao and committed by
Jens Axboe
e7eea44e 3e20aa96

+1
+1
drivers/block/virtio_blk.c
··· 878 878 put_disk(vblk->disk); 879 879 out_free_vq: 880 880 vdev->config->del_vqs(vdev); 881 + kfree(vblk->vqs); 881 882 out_free_vblk: 882 883 kfree(vblk); 883 884 out_free_index: