From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVLu-0006eg-6N for qemu-devel@nongnu.org; Fri, 22 Jul 2016 03:58:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQVLo-000671-A2 for qemu-devel@nongnu.org; Fri, 22 Jul 2016 03:58:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQVLo-00066w-5P for qemu-devel@nongnu.org; Fri, 22 Jul 2016 03:58:28 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A88657F7C0 for ; Fri, 22 Jul 2016 07:58:27 +0000 (UTC) Message-ID: <1469174305.3363.92.camel@redhat.com> From: Gerd Hoffmann Date: Fri, 22 Jul 2016 09:58:25 +0200 In-Reply-To: <20160719085432.4572-29-marcandre.lureau@redhat.com> References: <20160719085432.4572-1-marcandre.lureau@redhat.com> <20160719085432.4572-29-marcandre.lureau@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 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: marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org > --- a/hw/input/virtio-input-hid.c > +++ b/hw/input/virtio-input-hid.c > + .instance_finalize =3D virtio_input_finalize, > --- a/hw/input/virtio-input.c > +++ b/hw/input/virtio-input.c > +void virtio_input_finalize(Object *obj) > +{ > + VirtIOInput *vinput =3D 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