From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFdY-0003bG-BM for qemu-devel@nongnu.org; Thu, 21 Jul 2016 11:11:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQFdT-0005Z0-Vx for qemu-devel@nongnu.org; Thu, 21 Jul 2016 11:11:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQFdT-0005Yn-QC for qemu-devel@nongnu.org; Thu, 21 Jul 2016 11:11:39 -0400 Date: Thu, 21 Jul 2016 16:11:37 +0100 From: "Richard W.M. Jones" Message-ID: <20160721151137.GR1688@redhat.com> References: <1469112292-30548-1-git-send-email-minyard@acm.org> <1469112292-30548-2-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1469112292-30548-2-git-send-email-minyard@acm.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] wdt_i6300esb: Free timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: minyard@acm.org Cc: qemu-devel@nongnu.org, =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Corey Minyard On Thu, Jul 21, 2016 at 09:44:51AM -0500, minyard@acm.org wrote: > From: Corey Minyard >=20 > Add an exit function to free the timer allocated in the > realize function. >=20 > Signed-off-by: Corey Minyard > Cc: Richard W.M. Jones > Cc: Marc-Andr=E9 Lureau > --- > hw/watchdog/wdt_i6300esb.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c > index a83d951..49b3cd1 100644 > --- a/hw/watchdog/wdt_i6300esb.c > +++ b/hw/watchdog/wdt_i6300esb.c > @@ -428,6 +428,14 @@ static void i6300esb_realize(PCIDevice *dev, Error= **errp) > /* qemu_register_coalesced_mmio (addr, 0x10); ? */ > } > =20 > +static void i6300esb_exit(PCIDevice *dev) > +{ > + I6300State *d =3D WATCHDOG_I6300ESB_DEVICE(dev); > + > + timer_del(d->timer); > + timer_free(d->timer); > +} > + > static WatchdogTimerModel model =3D { > .wdt_name =3D "i6300esb", > .wdt_description =3D "Intel 6300ESB", > @@ -441,6 +449,7 @@ static void i6300esb_class_init(ObjectClass *klass,= void *data) > k->config_read =3D i6300esb_config_read; > k->config_write =3D i6300esb_config_write; > k->realize =3D i6300esb_realize; > + k->exit =3D i6300esb_exit; > k->vendor_id =3D PCI_VENDOR_ID_INTEL; > k->device_id =3D PCI_DEVICE_ID_INTEL_ESB_9; > k->class_id =3D PCI_CLASS_SYSTEM_OTHER; With the caveat that I only examined the code and compile-tested it: Reviewed-by: Richard W.M. Jones Rich. --=20 Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rj= ones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top