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 <wangjian...@huawei.com> > --- > 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 <stefa...@redhat.com>
signature.asc
Description: PGP signature