qemu-e2k/hw/usb
fangying 7cec2ed9d7 xhci: Fix memory leak in xhci_kick_epctx
Address Sanitizer shows memory leak in xhci_kick_epctx hw/usb/hcd-xhci.c:1912.
A sglist is leaked when a packet is retired and returns USB_RET_NAK status.
The leak stack is as bellow:

Direct leak of 2688 byte(s) in 168 object(s) allocated from:
    #0 0xffffae8b11db in __interceptor_malloc (/lib64/libasan.so.4+0xd31db)
    #1 0xffffae5c9163 in g_malloc (/lib64/libglib-2.0.so.0+0x57163)
    #2 0xaaaabb6fb3f7 in qemu_sglist_init dma-helpers.c:43
    #3 0xaaaabba705a7 in pci_dma_sglist_init include/hw/pci/pci.h:837
    #4 0xaaaabba705a7 in xhci_xfer_create_sgl hw/usb/hcd-xhci.c:1443
    #5 0xaaaabba705a7 in xhci_setup_packet hw/usb/hcd-xhci.c:1615
    #6 0xaaaabba77a6f in xhci_kick_epctx hw/usb/hcd-xhci.c:1912
    #7 0xaaaabbdaad27 in timerlist_run_timers util/qemu-timer.c:592
    #8 0xaaaabbdab19f in qemu_clock_run_timers util/qemu-timer.c:606
    #9 0xaaaabbdab19f in qemu_clock_run_all_timers util/qemu-timer.c:692
    #10 0xaaaabbdab9a3 in main_loop_wait util/main-loop.c:524
    #11 0xaaaabb6ff5e7 in main_loop vl.c:1806
    #12 0xaaaabb1e1453 in main vl.c:4488

Signed-off-by: Ying Fang <fangying1@huawei.com>
Message-id: 20190828062535.1573-1-fangying1@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-08-29 07:30:04 +02:00
..
Kconfig hw/usb/Kconfig: USB_XHCI_NEC requires USB_XHCI 2019-07-15 20:58:37 +02:00
Makefile.objs hw/usb/Kconfig: Add CONFIG_USB_EHCI_PCI 2019-07-15 20:58:37 +02:00
bus.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ccid-card-emulated.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ccid-card-passthru.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ccid.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
chipidea.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
combined-packet.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
core.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
desc-msos.c usb: use local path for local headers 2018-06-01 19:20:38 +03:00
desc.c usb: use local path for local headers 2018-06-01 19:20:38 +03:00
desc.h all: Clean up includes 2016-02-23 12:43:05 +00:00
dev-audio.c audio: add audiodev properties to frontends 2019-08-21 09:13:37 +02:00
dev-bluetooth.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
dev-hid.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-hub.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-mtp.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-network.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-serial.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-smartcard-reader.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-storage.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-uas.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
dev-wacom.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
hcd-ehci-pci.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hcd-ehci-sysbus.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hcd-ehci.c ehci: fix queue->dev null ptr dereference 2019-08-22 06:55:29 +02:00
hcd-ehci.h sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h 2019-08-16 13:31:53 +02:00
hcd-musb.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
hcd-ohci-pci.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hcd-ohci.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hcd-ohci.h hw/usb/hcd-ohci: Move PCI-related code into a separate file 2019-05-02 08:42:17 +02:00
hcd-uhci.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hcd-xhci-nec.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hcd-xhci.c xhci: Fix memory leak in xhci_kick_epctx 2019-08-29 07:30:04 +02:00
hcd-xhci.h Supply missing header guards 2019-06-12 13:20:21 +02:00
host-libusb.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
host-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
host.h usb-host: move legacy cmd line bits 2013-02-19 12:30:05 +01:00
libhw.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
quirks-ftdi-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks-pl2303-ids.h usbredir: Add support for buffered bulk input (v2) 2013-01-08 10:56:58 +01:00
quirks.c usb: Clean up includes 2016-01-29 15:07:23 +00:00
quirks.h Supply missing header guards 2019-06-12 13:20:21 +02:00
redirect.c usb-redir: merge interrupt packets 2019-08-21 10:42:00 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
tusb6010.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
xen-usb.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00