From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVgv-0007px-Lp for qemu-devel@nongnu.org; Fri, 22 Jul 2016 04:20:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQVgs-0002XL-Ce for qemu-devel@nongnu.org; Fri, 22 Jul 2016 04:20:17 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:42695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVgs-0002Wx-52 for qemu-devel@nongnu.org; Fri, 22 Jul 2016 04:20:14 -0400 Date: Fri, 22 Jul 2016 04:20:12 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <493885991.7245924.1469175612415.JavaMail.zimbra@redhat.com> In-Reply-To: <1469174305.3363.92.camel@redhat.com> References: <20160719085432.4572-1-marcandre.lureau@redhat.com> <20160719085432.4572-29-marcandre.lureau@redhat.com> <1469174305.3363.92.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 28/37] virtio-input: free config list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: marcandre lureau , qemu-devel@nongnu.org Hi ----- Original Message ----- > > --- 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). > Yes, not sure why I didn't do that in the first, place. fixed.