qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: minyard@acm.org
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <mlureau@redhat.com>,
	minyard@acm.org, "Corey Minyard" <cminyard@mvista.com>,
	"Richard W . M . Jones" <rjones@redhat.com>
Subject: [Qemu-devel] [PATCH v2 2/3] wdt_i6300esb: Free timer
Date: Thu, 21 Jul 2016 11:49:08 -0500	[thread overview]
Message-ID: <1469119749-31181-3-git-send-email-minyard@acm.org> (raw)
In-Reply-To: <1469119749-31181-1-git-send-email-minyard@acm.org>

From: Corey Minyard <cminyard@mvista.com>

Add an exit function to free the timer allocated in the
realize function.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
---
 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

  parent reply	other threads:[~2016-07-21 16:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 16:49 [Qemu-devel] [PATCH v2 0/3] Handle freeing data in some devices minyard
2016-07-21 16:49 ` [Qemu-devel] [PATCH v2 1/3] ipmi_bmc_sim: Add a proper unrealize function minyard
2016-07-22  9:22   ` Marc-André Lureau
2016-07-22 12:14     ` Corey Minyard
2016-07-21 16:49 ` minyard [this message]
2016-07-21 16:49 ` [Qemu-devel] [PATCH v2 3/3] wdt_ib700: Free timer minyard
2016-07-22  9:26   ` Marc-André Lureau
2016-07-22 10:12     ` Richard W.M. Jones
2016-07-22 12:12       ` Corey Minyard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469119749-31181-3-git-send-email-minyard@acm.org \
    --to=minyard@acm.org \
    --cc=cminyard@mvista.com \
    --cc=mlureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).