qemu-e2k/hw
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
..
9pfs 9p: simplify source file selection 2019-08-20 17:26:19 +02:00
acpi hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
adc Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
alpha Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
arm Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
audio audio: remove audio_MIN, audio_MAX 2019-08-21 09:13:37 +02:00
block Block layer patches: 2019-08-16 16:43:46 +01:00
bt Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
char spapr: Implement better workaround in spapr-vty device 2019-08-21 17:17:39 +10:00
core Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
cpu hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cris Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
display vga: a collection of ati fixes/improvements. 2019-08-22 16:13:17 +01:00
dma hw/dma/omap_dma: Move switch 'fall through' comment to correct place 2019-08-21 10:55:23 +02:00
gpio Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hppa Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
hyperv Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
i2c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
i386 xen: cleanup IOREQ server on exit 2019-08-27 14:18:28 +01:00
ide hw/ide/atapi: Use the ldst API 2019-08-16 19:14:04 -04:00
input sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
intc Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi hw/ipmi: Rewrite a fall through comment 2019-08-21 10:56:19 +02:00
isa hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
lm32 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
m68k Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
mem numa: Move remaining NUMA declarations from sysemu.h to numa.h 2019-08-16 13:31:53 +02:00
microblaze hw/misc: Add a config switch for the "unimplemented" device 2019-08-20 09:11:17 +02:00
mips target/mips: Style improvements in mips_mipssim.c 2019-08-19 19:53:37 +02:00
misc hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
moxie Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net hw/net/e1000: Fix erroneous comment 2019-08-21 10:42:10 +02:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
nvram sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
pci-bridge Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci-host hw/core: Add a config switch for the "or-irq" device 2019-08-20 09:11:17 +02:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
rdma sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
riscv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
s390x hw: add compat machines for 4.2 2019-08-21 11:32:11 +10:00
scsi vhost-user-scsi: prevent using uninitialized vqs 2019-08-22 16:52:23 +01:00
sd Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
semihosting Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
sh4 sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
smbios Clean up inclusion of exec/cpu-common.h 2019-08-16 13:31:52 +02:00
sparc sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sparc64 hw/misc: Add a config switch for the "unimplemented" device 2019-08-20 09:11:17 +02:00
ssi Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
timer Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
tpm Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tricore Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
unicore32 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
usb xhci: Fix memory leak in xhci_kick_epctx 2019-08-29 07:30:04 +02:00
vfio sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
virtio sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
watchdog sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
xen xen-bus: Avoid rewriting identical values to xenstore 2019-08-27 14:18:28 +01:00
xenpv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xtensa sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
Kconfig hw/core: Add a config switch for the "register" device 2019-08-20 09:11:05 +02:00
Makefile.objs Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs 2019-07-15 20:58:37 +02:00