[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/32] serial: fix memory leak in serial exit
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 19/32] serial: fix memory leak in serial exit |
Date: |
Mon, 16 Jan 2017 17:59:03 +0100 |
From: Li Qiang <address@hidden>
The serial_exit_core function doesn't free some resources.
This can lead memory leak when hotplug and unplug. This
patch avoid this.
Signed-off-by: Li Qiang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/char/serial.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/char/serial.c b/hw/char/serial.c
index ffbacd8..67b18ed 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -906,6 +906,16 @@ void serial_realize_core(SerialState *s, Error **errp)
void serial_exit_core(SerialState *s)
{
qemu_chr_fe_deinit(&s->chr);
+
+ timer_del(s->modem_status_poll);
+ timer_free(s->modem_status_poll);
+
+ timer_del(s->fifo_timeout_timer);
+ timer_free(s->fifo_timeout_timer);
+
+ fifo8_destroy(&s->recv_fifo);
+ fifo8_destroy(&s->xmit_fifo);
+
qemu_unregister_reset(serial_reset, s);
}
--
2.9.3
- [Qemu-devel] [PULL 12/32] stubs: move vhost stubs to stubs/vhost.o, (continued)
- [Qemu-devel] [PULL 12/32] stubs: move vhost stubs to stubs/vhost.o, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 10/32] stubs: group stubs for user-mode emulation, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 09/32] hw: move reset handlers from vl.c to hw/core, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 13/32] event_notifier: cleanups around event_notifier_set_handler, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 14/32] build: remove --enable-colo/--disable-colo, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 15/32] stubs: remove stubs/kvm.c, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 16/32] acpi: filter based on CONFIG_ACPI_X86 rather than TARGET, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 20/32] qemu-thread: fix qemu_thread_set_name() race in qemu_thread_create(), Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 17/32] pc: fix crash in rtc_set_memory() if initial cpu is marked as hotplugged, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 18/32] scsi-block: fix direction of BYTCHK test for VERIFY commands, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 19/32] serial: fix memory leak in serial exit,
Paolo Bonzini <=
- [Qemu-devel] [PULL 21/32] hxtool: emit Texinfo headings as @subsection, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 24/32] x86: ioapic: fix fail migration when irqchip=split, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 22/32] x86: ioapic: add traces for ioapic, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 23/32] x86: ioapic: dump version for "info ioapic", Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 25/32] exec: Add missing rcu_read_unlock, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 26/32] char: fix ctrl-a b not working, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 27/32] ramblock-notifier: new, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 28/32] kvm: move cpu synchronization code, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 32/32] Revert "win32: don't run subprocess tests on Mingw32 platform", Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 30/32] Plumb the HAXM-based hardware acceleration support, Paolo Bonzini, 2017/01/16