From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQDfn-00030L-It for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:05:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQDfl-0002us-CJ for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:05:54 -0400 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:34206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQDfl-0002uf-4l for qemu-devel@nongnu.org; Thu, 21 Jul 2016 09:05:53 -0400 Received: by mail-pa0-x244.google.com with SMTP id hh10so5258062pac.1 for ; Thu, 21 Jul 2016 06:05:52 -0700 (PDT) Reply-To: minyard@acm.org References: <20160719085432.4572-1-marcandre.lureau@redhat.com> <20160719085432.4572-30-marcandre.lureau@redhat.com> From: Corey Minyard Message-ID: <5790C8AD.1070701@gmail.com> Date: Thu, 21 Jul 2016 08:05:49 -0500 MIME-Version: 1.0 In-Reply-To: <20160719085432.4572-30-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 29/37] ipmi: free extern timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org I believe this is correct: Reviewed-by: Corey Minyard 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? -corey On 07/19/2016 03:54 AM, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > Free the timer allocated during instance init. > > Signed-off-by: Marc-André 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); > } > > +static void ipmi_bmc_extern_finalize(Object *obj) > +{ > + IPMIBmcExtern *ibe = IPMI_BMC_EXTERN(obj); > + > + timer_del(ibe->extern_timer); > + timer_free(ibe->extern_timer); > +} > + > static Property ipmi_bmc_extern_properties[] = { > DEFINE_PROP_CHR("chardev", IPMIBmcExtern, chr), > DEFINE_PROP_END_OF_LIST(), > @@ -508,6 +516,7 @@ static const TypeInfo ipmi_bmc_extern_type = { > .parent = TYPE_IPMI_BMC, > .instance_size = sizeof(IPMIBmcExtern), > .instance_init = ipmi_bmc_extern_init, > + .instance_finalize = ipmi_bmc_extern_finalize, > .class_init = ipmi_bmc_extern_class_init, > }; >