qemu-patch-raspberry4/hw
Jincheng Miao 3ce2144538 usb: initialize libusb_device to avoid crash
If libusb_get_device_list() fails, the uninitialized local variable
libusb_device would be passed to libusb_free_device_list(), that
will cause a crash, like:
(gdb) bt
 #0  0x00007fbbb4bafc10 in pthread_mutex_lock () from /lib64/libpthread.so.0
 #1  0x00007fbbb233e653 in libusb_unref_device (dev=0x6275682d627375)
     at core.c:902
 #2  0x00007fbbb233e739 in libusb_free_device_list (list=0x7fbbb6e8436e,
     unref_devices=<optimized out>) at core.c:653
 #3  0x00007fbbb6cd80a4 in usb_host_auto_check (unused=unused@entry=0x0)
     at hw/usb/host-libusb.c:1446
 #4  0x00007fbbb6cd8525 in usb_host_initfn (udev=0x7fbbbd3c5670)
     at hw/usb/host-libusb.c:912
 #5  0x00007fbbb6cc123b in usb_device_init (dev=0x7fbbbd3c5670)
     at hw/usb/bus.c:106
 ...

So initialize libusb_device at the begin time.

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-07-01 13:26:37 +02:00
..
9pfs virtio-9p: use virtio wrappers to access headers 2014-06-29 19:39:43 +03:00
acpi qmp: convert ACPI_DEVICE_OST event 2014-06-23 11:12:28 -04:00
alpha machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
arm hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
audio audio: fmopl: drop INLINE macro 2014-06-23 11:01:24 -04:00
block virtio-blk: use virtio wrappers to access headers 2014-06-29 19:39:42 +03:00
bt Preparation for usb-bt-dongle conditional build 2013-09-10 11:14:41 +02:00
char irq: Allocate IRQs individually 2014-07-01 04:02:53 +02:00
core irq: Slim conversion of qemu_irq to QOM 2014-07-01 04:12:48 +02:00
cpu icc_bus: QOM'ify ICC 2013-12-24 18:02:18 +01:00
cris machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
display spice: fix 32bit build 2014-06-20 16:22:07 +01:00
dma hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
gpio savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
i2c savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
i386 pc: make isapc and pc-0.10 to pc-0.13 have 1.7.0 memory layout 2014-06-29 18:59:41 +03:00
ide hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
input input: fix jumpy mouse cursor with USB mouse emulation 2014-07-01 13:26:37 +02:00
intc xics: Implement xics_ics_free() 2014-06-27 13:48:26 +02:00
ipack irq: Allocate IRQs individually 2014-07-01 04:02:53 +02:00
isa acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices 2014-06-19 18:44:22 +03:00
lm32 machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
m68k machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
mem qmp: add query-memory-devices command 2014-06-19 18:44:22 +03:00
microblaze ssi: Name the CS GPIO 2014-05-28 17:36:21 +02:00
mips gt64xxx_pci: Add VMStateDescription 2014-06-20 23:40:16 +02:00
misc hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
moxie hw/moxie/moxiesim.c: Remove unused moxie_intc_create() 2014-06-24 20:01:24 +04:00
net vhost-net: disable when cross-endian 2014-06-29 19:39:43 +03:00
nvram spapr: Fix RTAS token numbers 2014-06-27 13:48:22 +02:00
openrisc machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
pci pcie: coding style tweak 2014-06-23 17:49:49 +03:00
pci-bridge hw/pcie: implement power controller functionality 2014-06-23 17:48:42 +03:00
pci-host uninorth: Fix PCI hole size 2014-06-27 13:48:24 +02:00
pcmcia hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
ppc PPC: e500: Only create dt entries for existing serial ports 2014-06-27 13:48:27 +02:00
s390x s390x: cleanup interrupt injection 2014-06-10 09:50:27 +02:00
scsi virtio-scsi: scsi events must be converted to target endianness 2014-07-01 09:40:38 +02:00
sd hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
sh4 hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
sparc tcx: move initialisation from realizefn to initfn 2014-06-05 20:51:57 +01:00
sparc64 machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
ssi ssi: Name the CS GPIO 2014-05-28 17:36:21 +02:00
timer hw: Fix qemu_allocate_irqs() leaks 2014-06-30 21:13:30 +02:00
tpm aio / timers: Untangle include files 2013-08-22 19:10:27 +02:00
unicore32 machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
usb usb: initialize libusb_device to avoid crash 2014-07-01 13:26:37 +02:00
virtio virtio-balloon: use virtio wrappers to access page frame numbers 2014-06-29 19:39:42 +03:00
watchdog qapi event: clean up in callers 2014-06-27 09:27:56 -04:00
xen trivial patches for 2014-05-07 2014-05-07 18:38:39 +01:00
xenpv machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
xtensa hw/xtensa/xtfpga: implement initrd loading 2014-06-29 02:32:42 +04:00
Makefile.objs pc: implement pc-dimm device abstraction 2014-06-19 16:41:47 +03:00