From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQH9x-0004Ws-TZ for qemu-devel@nongnu.org; Thu, 21 Jul 2016 12:49:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQH9w-0004iE-4t for qemu-devel@nongnu.org; Thu, 21 Jul 2016 12:49:17 -0400 Received: from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242]:35601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQH9w-0004i7-0Q for qemu-devel@nongnu.org; Thu, 21 Jul 2016 12:49:16 -0400 Received: by mail-oi0-x242.google.com with SMTP id w143so8200169oiw.2 for ; Thu, 21 Jul 2016 09:49:15 -0700 (PDT) Sender: Corey Minyard From: minyard@acm.org Date: Thu, 21 Jul 2016 11:49:08 -0500 Message-Id: <1469119749-31181-3-git-send-email-minyard@acm.org> In-Reply-To: <1469119749-31181-1-git-send-email-minyard@acm.org> References: <1469119749-31181-1-git-send-email-minyard@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 2/3] wdt_i6300esb: Free timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , minyard@acm.org, Corey Minyard , "Richard W . M . Jones" From: Corey Minyard Add an exit function to free the timer allocated in the realize function. Signed-off-by: Corey Minyard Cc: Richard W.M. Jones Reviewed-by: Marc-André Lureau Reviewed-by: Richard W.M. Jones --- hw/watchdog/wdt_i6300esb.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); ? */ } +static void i6300esb_exit(PCIDevice *dev) +{ + I6300State *d = WATCHDOG_I6300ESB_DEVICE(dev); + + timer_del(d->timer); + timer_free(d->timer); +} + static WatchdogTimerModel model = { .wdt_name = "i6300esb", .wdt_description = "Intel 6300ESB", @@ -441,6 +449,7 @@ static void i6300esb_class_init(ObjectClass *klass, void *data) k->config_read = i6300esb_config_read; k->config_write = i6300esb_config_write; k->realize = i6300esb_realize; + k->exit = i6300esb_exit; k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_ESB_9; k->class_id = PCI_CLASS_SYSTEM_OTHER; -- 2.7.4