From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQDk8-00051j-8g for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:10:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQDk1-0003XT-IA for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:10:23 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:42814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQDk1-0003XF-A8 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:10:17 -0400 Date: Thu, 21 Jul 2016 09:10:15 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <251192172.7058597.1469106615846.JavaMail.zimbra@redhat.com> In-Reply-To: <5790C8AD.1070701@gmail.com> References: <20160719085432.4572-1-marcandre.lureau@redhat.com> <20160719085432.4572-30-marcandre.lureau@redhat.com> <5790C8AD.1070701@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 29/37] ipmi: free extern timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: minyard@acm.org Cc: marcandre lureau , qemu-devel@nongnu.org Hi ----- Original Message ----- > I believe this is correct: >=20 > Reviewed-by: Corey Minyard >=20 > I looked around at other devices with timers, I found several (two > watchdogs, and ipmi_bmc_sim.c, for instance) that allocate the timer in > the realize function but don't deallocate it in the unrealize function. > Do those need to be fixed, too? Yes, I haven't found them myself, but I can include fixes in the series too= . thanks >=20 > -corey >=20 >=20 > On 07/19/2016 03:54 AM, marcandre.lureau@redhat.com wrote: > > From: Marc-Andr=C3=A9 Lureau > > > > Free the timer allocated during instance init. > > > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > --- > > hw/ipmi/ipmi_bmc_extern.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c > > index 157879e..5b73983 100644 > > --- a/hw/ipmi/ipmi_bmc_extern.c > > +++ b/hw/ipmi/ipmi_bmc_extern.c > > @@ -487,6 +487,14 @@ static void ipmi_bmc_extern_init(Object *obj) > > vmstate_register(NULL, 0, &vmstate_ipmi_bmc_extern, ibe); > > } > > =20 > > +static void ipmi_bmc_extern_finalize(Object *obj) > > +{ > > + IPMIBmcExtern *ibe =3D IPMI_BMC_EXTERN(obj); > > + > > + timer_del(ibe->extern_timer); > > + timer_free(ibe->extern_timer); > > +} > > + > > static Property ipmi_bmc_extern_properties[] =3D { > > DEFINE_PROP_CHR("chardev", IPMIBmcExtern, chr), > > DEFINE_PROP_END_OF_LIST(), > > @@ -508,6 +516,7 @@ static const TypeInfo ipmi_bmc_extern_type =3D { > > .parent =3D TYPE_IPMI_BMC, > > .instance_size =3D sizeof(IPMIBmcExtern), > > .instance_init =3D ipmi_bmc_extern_init, > > + .instance_finalize =3D ipmi_bmc_extern_finalize, > > .class_init =3D ipmi_bmc_extern_class_init, > > }; > > =20 >=20 >=20