qemu-e2k/hw/usb
Peter Maydell fedc1c1915 hw/usb/redirect.c: Stop using qemu_oom_check()
qemu_oom_check() is a function which essentially says "if you pass me
a NULL pointer then print a message then abort()".  On POSIX systems
the message includes strerror(errno); on Windows it includes the
GetLastError() error value printed as an integer.

Other than in the implementation of qemu_memalign(), we use this
function only in hw/usb/redirect.c, for three checks:

 * on a call to usbredirparser_create()
 * on a call to usberedirparser_serialize()
 * on a call to malloc()

The usbredir library API functions make no guarantees that they will
set errno on errors, let alone that they might set the
Windows-specific GetLastError string.  malloc() is documented as
setting errno, not GetLastError -- and in any case the only thing it
might set errno to is ENOMEM.  So qemu_oom_check() isn't the right
thing for any of these.  Replace them with straightforward
error-checking code.  This will allow us to get rid of
qemu_oom_check().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220226180723.1706285-2-peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-03-04 11:20:16 +01:00
..
bus.c qapi: introduce x-query-usb QMP command 2021-11-02 15:55:14 +00:00
ccid-card-emulated.c modules: add ccid module annotations 2021-07-09 18:20:27 +02:00
ccid-card-passthru.c modules: add ccid module annotations 2021-07-09 18:20:27 +02:00
ccid.h
chipidea.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
combined-packet.c usb: limit combined packets to 1 MiB (CVE-2021-3527) 2021-05-05 15:06:01 +02:00
core.c
desc-msos.c hw/usb: Fix typo in comments and print 2021-09-01 06:37:13 +02:00
desc.c usb: allow max 8192 bytes for desc 2022-01-13 10:22:37 +01:00
desc.h usb: allow max 8192 bytes for desc 2022-01-13 10:22:37 +01:00
dev-audio.c hw/usb: Fix typo in comments and print 2021-09-01 06:37:13 +02:00
dev-hid.c hid: Implement support for side and extra buttons 2022-02-22 17:15:36 +01:00
dev-hub.c
dev-mtp.c hw/usb/dev-mtp: create directories with a+x mode mask 2022-03-04 09:34:21 +01:00
dev-network.c
dev-serial.c usb: remove support for -usbdevice parameters 2021-03-15 17:00:58 +01:00
dev-smartcard-reader.c qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
dev-storage-bot.c scsi: Replace scsi_bus_new() with scsi_bus_init(), scsi_bus_init_named() 2021-09-30 13:42:10 +01:00
dev-storage-classic.c scsi: Replace scsi_bus_new() with scsi_bus_init(), scsi_bus_init_named() 2021-09-30 13:42:10 +01:00
dev-storage.c usb/storage: clear csw on reset 2021-03-15 17:01:17 +01:00
dev-uas.c uas: add missing return 2022-01-13 10:58:05 +01:00
dev-wacom.c hw/usb/dev-wacom: add missing HID descriptor 2022-01-13 10:22:00 +01:00
hcd-dwc2.c dma: Let dma_memory_read/write() take MemTxAttrs argument 2021-12-30 17:16:32 +01:00
hcd-dwc2.h
hcd-dwc3.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
hcd-ehci-pci.c
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 dma: Let dma_memory_read/write() take MemTxAttrs argument 2021-12-30 17:16:32 +01:00
hcd-ehci.h
hcd-musb.c
hcd-ohci-pci.c
hcd-ohci.c usb/ohci: Don't use packet from OHCIState for isochronous transfers 2022-03-04 09:34:21 +01:00
hcd-ohci.h
hcd-uhci.c usb/uhci: Replace pci_set_irq with qemu_set_irq 2021-11-02 14:32:32 +01:00
hcd-uhci.h usb/uhci: Replace pci_set_irq with qemu_set_irq 2021-11-02 14:32:32 +01:00
hcd-xhci-nec.c
hcd-xhci-pci.c hw/usb: hcd-xhci-pci: Fix spec violation of IP flag for MSI/MSI-X 2021-05-28 09:10:20 +02:00
hcd-xhci-pci.h
hcd-xhci-sysbus.c hw/usb: hcd-xhci-pci: Fix spec violation of IP flag for MSI/MSI-X 2021-05-28 09:10:20 +02:00
hcd-xhci-sysbus.h
hcd-xhci.c hw/usb: pacify xhciwmi.exe warning 2022-03-04 09:34:21 +01:00
hcd-xhci.h hw/usb: hcd-xhci-pci: Fix spec violation of IP flag for MSI/MSI-X 2021-05-28 09:10:20 +02:00
host-libusb.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
host.h
imx-usb-phy.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
Kconfig usb/storage: add kconfig symbols 2021-03-15 17:01:12 +01:00
libhw.c dma: Let dma_memory_map() take MemTxAttrs argument 2021-12-30 17:16:32 +01:00
meson.build usb: fix usb-host dependency check 2021-07-22 14:44:47 +02:00
pcap.c usb/pcap: set flag_setup 2021-02-17 14:29:12 +01:00
quirks-ftdi-ids.h hw/usb: Fix typo in comments and print 2021-09-01 06:37:13 +02:00
quirks-pl2303-ids.h
quirks.c
quirks.h Drop the deprecated lm32 target 2021-05-12 18:20:25 +02:00
redirect.c hw/usb/redirect.c: Stop using qemu_oom_check() 2022-03-04 11:20:16 +01:00
trace-events usb/ohci: Move trace point and log ep number to help debugging 2022-03-04 09:34:21 +01:00
trace.h
tusb6010.c
u2f-emulated.c hw/usb: Fix typo in comments and print 2021-09-01 06:37:13 +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
vt82c686-uhci-pci.c hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts 2021-11-02 14:32:32 +01:00
xen-usb.c hw: Do not include hw/sysbus.h if it is not necessary 2021-05-02 17:24:50 +02:00
xlnx-usb-subsystem.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00
xlnx-versal-usb2-ctrl-regs.c hw: Do not include qemu/log.h if it is not necessary 2021-05-02 17:24:50 +02:00