qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 28/37] virtio-input: free config list


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 28/37] virtio-input: free config list
Date: Fri, 22 Jul 2016 09:58:25 +0200

> --- a/hw/input/virtio-input-hid.c
> +++ b/hw/input/virtio-input-hid.c

> +    .instance_finalize = virtio_input_finalize,

> --- a/hw/input/virtio-input.c
> +++ b/hw/input/virtio-input.c

> +void virtio_input_finalize(Object *obj)
> +{
> +    VirtIOInput *vinput = VIRTIO_INPUT(obj);
> +    VirtIOInputConfig *cfg, *next;
> +
> +    QTAILQ_FOREACH_SAFE(cfg, &vinput->cfg_list, node, next) {
> +        QTAILQ_REMOVE(&vinput->cfg_list, cfg, node);
> +        g_free(cfg);
> +    }
> +}

I think you can keep this local to virtio-input.c and simply hook it
into the abstract base class (TYPE_VIRTIO_INPUT).

Other than that it looks fine to me.

cheers,
  Gerd




reply via email to

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