qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] virtio-input: fix memory leak on unrealize


From: Michael S. Tsirkin
Subject: Re: [PATCH 1/3] virtio-input: fix memory leak on unrealize
Date: Fri, 8 Nov 2019 04:53:33 -0500

On Thu, Nov 07, 2019 at 11:27:29PM +0400, Marc-André Lureau wrote:
> Spotted by ASAN + minor stylistic change.
> 
> Signed-off-by: Marc-André Lureau <address@hidden>

Reviewed-by: Michael S. Tsirkin <address@hidden>

> ---
>  hw/input/virtio-input.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c
> index 51617a5885..ec54e46ad6 100644
> --- a/hw/input/virtio-input.c
> +++ b/hw/input/virtio-input.c
> @@ -275,6 +275,7 @@ static void virtio_input_finalize(Object *obj)
>  
>      g_free(vinput->queue);
>  }
> +
>  static void virtio_input_device_unrealize(DeviceState *dev, Error **errp)
>  {
>      VirtIOInputClass *vic = VIRTIO_INPUT_GET_CLASS(dev);
> @@ -288,6 +289,8 @@ static void virtio_input_device_unrealize(DeviceState 
> *dev, Error **errp)
>              return;
>          }
>      }
> +    virtio_del_queue(vdev, 0);
> +    virtio_del_queue(vdev, 1);
>      virtio_cleanup(vdev);
>  }
>  
> -- 
> 2.24.0.rc0.20.gd81542e6f3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]