All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-blk: Fix memory leak among suspend/resume procedure
@ 2021-05-17  8:43 Xie Yongji
  2021-05-25  6:20   ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Xie Yongji @ 2021-05-17  8:43 UTC (permalink / raw)
  To: mst, jasowang, stefanha; +Cc: virtualization, linux-kernel

The vblk->vqs should be freed before we call init_vqs()
in virtblk_restore().

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
---
 drivers/block/virtio_blk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 367a1e929d7c..d24a8cea9aab 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -948,6 +948,8 @@ static int virtblk_freeze(struct virtio_device *vdev)
 	blk_mq_quiesce_queue(vblk->disk->queue);
 
 	vdev->config->del_vqs(vdev);
+	kfree(vblk->vqs);
+
 	return 0;
 }
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-blk: Fix memory leak among suspend/resume procedure
  2021-05-17  8:43 [PATCH] virtio-blk: Fix memory leak among suspend/resume procedure Xie Yongji
@ 2021-05-25  6:20   ` Jason Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2021-05-25  6:20 UTC (permalink / raw)
  To: Xie Yongji, mst, stefanha; +Cc: virtualization, linux-kernel


在 2021/5/17 下午4:43, Xie Yongji 写道:
> The vblk->vqs should be freed before we call init_vqs()
> in virtblk_restore().
>
> Signed-off-by: Xie Yongji <xieyongji@bytedance.com>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   drivers/block/virtio_blk.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 367a1e929d7c..d24a8cea9aab 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -948,6 +948,8 @@ static int virtblk_freeze(struct virtio_device *vdev)
>   	blk_mq_quiesce_queue(vblk->disk->queue);
>   
>   	vdev->config->del_vqs(vdev);
> +	kfree(vblk->vqs);
> +
>   	return 0;
>   }
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-blk: Fix memory leak among suspend/resume procedure
@ 2021-05-25  6:20   ` Jason Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2021-05-25  6:20 UTC (permalink / raw)
  To: Xie Yongji, mst, stefanha; +Cc: linux-kernel, virtualization


在 2021/5/17 下午4:43, Xie Yongji 写道:
> The vblk->vqs should be freed before we call init_vqs()
> in virtblk_restore().
>
> Signed-off-by: Xie Yongji <xieyongji@bytedance.com>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   drivers/block/virtio_blk.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 367a1e929d7c..d24a8cea9aab 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -948,6 +948,8 @@ static int virtblk_freeze(struct virtio_device *vdev)
>   	blk_mq_quiesce_queue(vblk->disk->queue);
>   
>   	vdev->config->del_vqs(vdev);
> +	kfree(vblk->vqs);
> +
>   	return 0;
>   }
>   

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-25  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17  8:43 [PATCH] virtio-blk: Fix memory leak among suspend/resume procedure Xie Yongji
2021-05-25  6:20 ` Jason Wang
2021-05-25  6:20   ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.