[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/25] watchdog: 6300esb: add exit function
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 05/25] watchdog: 6300esb: add exit function |
Date: |
Thu, 22 Dec 2016 16:22:40 +0100 |
From: Li Qiang <address@hidden>
When the Intel 6300ESB watchdog is hot unplug. The timer allocated
in realize isn't freed thus leaking memory leak. This patch avoid
this through adding the exit function.
Signed-off-by: Li Qiang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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.9.3
- [Qemu-devel] [PULL 00/25] First round of misc patches for QEMU 2.9, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 01/25] exec: optimize remaining address_space_* cases, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 04/25] exec: introduce MemoryRegionCache, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 02/25] exec: introduce memory_ldst.inc.c, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 03/25] exec: introduce address_space_extend_translation, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 05/25] watchdog: 6300esb: add exit function,
Paolo Bonzini <=
- [Qemu-devel] [PULL 07/25] rules.mak: add more rules to avoid chaining, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 08/25] build-sys: remove libtool left-over, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 06/25] rules.mak: speedup save-vars load-vars, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 09/25] virtio-scsi: introduce virtio_scsi_acquire/release, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 10/25] qemu-timer: check active_timers outside lock/event, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 11/25] timer: fix misleading comment in timer.h, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 12/25] main-loop: update comment for qemu_mutex_lock/unlock_iothread, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 13/25] block: drop remaining legacy aio functions in comment, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 15/25] pc: make smbus configurable, Paolo Bonzini, 2016/12/22
- [Qemu-devel] [PULL 17/25] pc: make pit configurable, Paolo Bonzini, 2016/12/22