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
ccid-card-passthru.c
ccid.h
chipidea.c
combined-packet.c
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
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
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
hcd-ehci-pci.c
hcd-ehci-sysbus.c
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
hcd-xhci-pci.h
hcd-xhci-sysbus.c
hcd-xhci-sysbus.h
hcd-xhci.c hw/usb: pacify xhciwmi.exe warning 2022-03-04 09:34:21 +01:00
hcd-xhci.h
host-libusb.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
host.h
imx-usb-phy.c
Kconfig
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
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
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.c
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
xlnx-usb-subsystem.c
xlnx-versal-usb2-ctrl-regs.c