diff options
author | Hou Tao <houtao1@huawei.com> | 2020-06-15 12:14:59 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-09 09:35:56 +0200 |
commit | 0733b1a2be5daea27c48da09dc02f6d015b92312 (patch) | |
tree | dc289851c0f07732b0d6983ba6004860e252abe9 | |
parent | a56fe733f4b7db8d909faa23f82afdd23ea9822f (diff) |
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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/block/virtio_blk.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index f287eec36b28..e57a1f6e39d5 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -749,6 +749,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: |