Thread (5 messages) 5 messages, 4 authors, 2020-07-01

Re: [PATCH] virtio-blk: free vblk-vqs in error path of virtblk_probe()

From: Ming Lei <hidden>
Date: 2020-06-30 22:30:34
Also in: virtualization

On Mon, Jun 15, 2020 at 12:14:59PM +0800, Hou Tao wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
 drivers/block/virtio_blk.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 9d21bf0f155e..980df853ee49 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -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:
-- 
2.25.0.4.g0ad7144999
Reviewed-by: Ming Lei <redacted>

-- 
Ming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help