qemu-e2k/hw/char
Pan Nengyuan e615c157f3 virtio-serial-bus: fix memory leak while attach virtio-serial-bus
ivqs/ovqs/c_ivq/c_ovq is forgot to cleanup in
virtio_serial_device_unrealize, the memory leak stack is as bellow:

Direct leak of 1290240 byte(s) in 180 object(s) allocated from:
    #0 0x7fc9bfc27560 in calloc (/usr/lib64/libasan.so.3+0xc7560)
    #1 0x7fc9bed6f015 in g_malloc0 (/usr/lib64/libglib-2.0.so.0+0x50015)
    #2 0x5650e02b83e7 in virtio_add_queue hw/virtio/virtio.c:2327
    #3 0x5650e02847b5 in virtio_serial_device_realize hw/char/virtio-serial-bus.c:1089
    #4 0x5650e02b56a7 in virtio_device_realize hw/virtio/virtio.c:3504
    #5 0x5650e03bf031 in device_set_realized hw/core/qdev.c:876
    #6 0x5650e0531efd in property_set_bool qom/object.c:2080
    #7 0x5650e053650e in object_property_set_qobject qom/qom-qobject.c:26
    #8 0x5650e0533e14 in object_property_set_bool qom/object.c:1338
    #9 0x5650e04c0e37 in virtio_pci_realize hw/virtio/virtio-pci.c:1801

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Amit Shah <amit@kernel.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1575444716-17632-3-git-send-email-pannengyuan@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
2020-01-05 07:03:03 -05:00
..
Kconfig hw/char: Move multi-serial devices into separate file 2019-05-17 15:19:39 +02:00
Makefile.objs hw/char: Move multi-serial devices into separate file 2019-05-17 15:19:39 +02:00
bcm2835_aux.c hw/arm/bcm2835_peripherals: Improve logging 2019-10-15 18:09:05 +01:00
cadence_uart.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
cmsdk-apb-uart.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
debugcon.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
digic-uart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
escc.c escc: introduce a selector for the register bit 2019-09-07 08:32:12 +02:00
etraxfs_ser.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
exynos4210_uart.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
grlib_apbuart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
imx_serial.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
ipoctal232.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
lm32_juart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
lm32_uart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
mcf_uart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
milkymist-uart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
nrf51_uart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
omap_uart.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
parallel-isa.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
parallel.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pl011.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
sclpconsole-lm.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
sclpconsole.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
serial-isa.c Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
serial-pci-multi.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
serial-pci.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
serial.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sh_serial.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
spapr_vty.c spapr: Replace spapr_vio_qirq() helper with spapr_vio_irq_pulse() helper 2019-10-04 19:08:22 +10:00
stm32f2xx_usart.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
terminal3270.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
trace-events trace-events: Fix attribution of trace points to source 2019-03-22 16:18:07 +00:00
virtio-console.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
virtio-serial-bus.c virtio-serial-bus: fix memory leak while attach virtio-serial-bus 2020-01-05 07:03:03 -05:00
xen_console.c Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xilinx_uartlite.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00