qemu-patch-raspberry4/hw/usb
Philippe Mathieu-Daudé 2da6e36b33 hw/usb/hcd-ehci-sysbus: Free USBPacket on instance finalize()
When building with --enable-sanitizers we get:

  Direct leak of 32 byte(s) in 2 object(s) allocated from:
      #0 0x5618479ec7cf in malloc (qemu-system-aarch64+0x233b7cf)
      #1 0x7f675745f958 in g_malloc (/lib64/libglib-2.0.so.0+0x58958)
      #2 0x561847f02ca2 in usb_packet_init hw/usb/core.c:531:5
      #3 0x561848df4df4 in usb_ehci_init hw/usb/hcd-ehci.c:2575:5
      #4 0x561847c119ac in ehci_sysbus_init hw/usb/hcd-ehci-sysbus.c:73:5
      #5 0x56184a5bdab8 in object_init_with_type qom/object.c:375:9
      #6 0x56184a5bd955 in object_init_with_type qom/object.c:371:9
      #7 0x56184a5a2bda in object_initialize_with_type qom/object.c:517:5
      #8 0x56184a5a24d5 in object_initialize qom/object.c:536:5
      #9 0x56184a5a2f6c in object_initialize_child_with_propsv qom/object.c:566:5
      #10 0x56184a5a2e60 in object_initialize_child_with_props qom/object.c:549:10
      #11 0x56184a5a3a1e in object_initialize_child_internal qom/object.c:603:5
      #12 0x561849542d18 in npcm7xx_init hw/arm/npcm7xx.c:427:5

Similarly to commit d710e1e7bd ("usb: ehci: fix memory leak in
ehci"), fix by calling usb_ehci_finalize() to free the USBPacket.

Fixes: 7341ea075c
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210323183701.281152-1-f4bug@amsat.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-03-26 09:14:48 +01:00
..
bus.c usb: remove support for -usbdevice parameters 2021-03-15 17:00:58 +01:00
ccid-card-emulated.c Various spelling fixes 2021-03-09 21:19:10 +01:00
ccid-card-passthru.c hw/usb: Fix bad printf format specifiers 2021-01-22 14:51:35 +01:00
ccid.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04: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 usb: add pcap support. 2021-01-22 14:51:35 +01: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 usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) 2021-03-15 17:00:58 +01:00
dev-hid.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
dev-hub.c Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
dev-mtp.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
dev-network.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
dev-serial.c usb: remove support for -usbdevice parameters 2021-03-15 17:00:58 +01:00
dev-smartcard-reader.c usb: Remove "-usbdevice ccid" 2021-03-26 06:37:03 +01:00
dev-storage-bot.c usb/storage: move usb-bot device to separate source file 2021-03-15 17:01:12 +01:00
dev-storage-classic.c usb/storage move usb-storage device to separate source file 2021-03-15 17:01:12 +01:00
dev-storage.c usb/storage: clear csw on reset 2021-03-15 17:01:17 +01:00
dev-uas.c scsi: drop 'result' argument from command_complete callback 2021-02-25 14:14:32 +01:00
dev-wacom.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
hcd-dwc2.c hw/usb/hcd-dwc2: fix divide-by-zero in dwc2_handle_packet() 2020-10-19 09:17:21 +02:00
hcd-dwc2.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
hcd-dwc3.c usb: Add DWC3 model 2020-12-15 12:04:30 +00:00
hcd-ehci-pci.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
hcd-ehci-sysbus.c hw/usb/hcd-ehci-sysbus: Free USBPacket on instance finalize() 2021-03-26 09:14:48 +01:00
hcd-ehci.c sysemu: Let VMChangeStateHandler take boolean 'running' argument 2021-03-09 23:13:57 +01:00
hcd-ehci.h hw/arm/npcm7xx: Add EHCI and OHCI controllers 2020-10-27 11:10:21 +00:00
hcd-musb.c exec/cpu-common: Move MUSB specific typedefs to 'hw/usb/hcd-musb.h' 2020-06-12 11:20:15 -04:00
hcd-ohci-pci.c Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
hcd-ohci.c Various spelling fixes 2021-03-09 21:19:10 +01:00
hcd-ohci.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
hcd-uhci.c hw/usb: Extract VT82C686 UHCI PCI function into a new unit 2021-03-15 17:00:59 +01:00
hcd-uhci.h hw/usb/hcd-uhci: Expose generic prototypes to local header 2021-03-15 17:00:59 +01:00
hcd-xhci-nec.c usb: Fix Lesser GPL version number 2020-11-15 16:40:48 +01:00
hcd-xhci-pci.c hw/usb: Convert to qdev_realize() 2021-01-22 14:51:35 +01:00
hcd-xhci-pci.h usb: Fix Lesser GPL version number 2020-11-15 16:40:48 +01:00
hcd-xhci-sysbus.c hw/usb: Convert to qdev_realize() 2021-01-22 14:51:35 +01:00
hcd-xhci-sysbus.h usb/xhci: add include/hw/usb/xhci.h header file 2020-10-21 11:36:19 +02:00
hcd-xhci.c Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
hcd-xhci.h hw/usb/hcd-xhci: Fix extraneous format-truncation error on 32-bit hosts 2021-01-22 14:51:35 +01:00
host-libusb.c sysemu: Let VMChangeStateHandler take boolean 'running' argument 2021-03-09 23:13:57 +01: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
imx-usb-phy.c hw/usb: Add basic i.MX USB Phy support 2020-03-17 11:23:14 +00:00
Kconfig usb/storage: add kconfig symbols 2021-03-15 17:01:12 +01:00
libhw.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
meson.build usb/storage: add kconfig symbols 2021-03-15 17:01:12 +01:00
pcap.c usb/pcap: set flag_setup 2021-02-17 14:29:12 +01: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 hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB 2020-03-16 23:02:25 +01:00
quirks.h hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB 2020-03-16 23:02:25 +01:00
redirect.c sysemu: Let VMChangeStateHandler take boolean 'running' argument 2021-03-09 23:13:57 +01:00
trace-events usb-storage: switch trace events 2020-11-16 09:11:21 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
tusb6010.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
u2f-emulated.c usb: fix u2f build 2020-09-21 09:44:54 +02:00
u2f-passthru.c u2f-passthru: put it into the 'misc' category 2021-02-20 12:36:19 +01:00
u2f.c usb: remove '-usbdevice u2f-key' 2021-03-15 17:00:58 +01:00
u2f.h hw/usb: Add U2F key base class 2020-08-31 08:10:47 +02:00
vt82c686-uhci-pci.c hw/usb: Extract VT82C686 UHCI PCI function into a new unit 2021-03-15 17:00:59 +01:00
xen-usb.c xen: Fix and improve handling of device_add usb-host errors 2020-05-27 07:45:17 +02:00
xlnx-usb-subsystem.c usb: xlnx-usb-subsystem: Add xilinx usb subsystem 2020-12-15 12:04:30 +00:00
xlnx-versal-usb2-ctrl-regs.c usb: Add versal-usb2-ctrl-regs module 2020-12-15 12:04:30 +00:00