[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] qemu: avoid memory leak while remove disk
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2] qemu: avoid memory leak while remove disk |
Date: |
Fri, 4 Jan 2019 15:09:32 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sat, Dec 22, 2018 at 06:27:28PM +0800, w00426999 wrote:
> Memset vhost_dev to zero in the vhost_dev_cleanup function.
> This causes dev.vqs to be NULL, so that
> vqs does not free up space when calling the g_free function.
> This will result in a memory leak. But you can't release vqs
> directly in the vhost_dev_cleanup function, because vhost_net
> will also call this function, and vhost_net's vqs is assigned by array.
> In order to solve this problem, we first save the pointer of vqs,
> and release the space of vqs after vhost_dev_cleanup is called.
>
> Signed-off-by: Jian Wang <address@hidden>
> ---
> hw/block/vhost-user-blk.c | 7 +++++--
> hw/scsi/vhost-scsi.c | 3 ++-
> hw/scsi/vhost-user-scsi.c | 3 ++-
> 3 files changed, 9 insertions(+), 4 deletions(-)
This patch can go through Michael's tree.
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [PATCH v2] qemu: avoid memory leak while remove disk,
Stefan Hajnoczi <=