toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/usb-linux.c b/usb-linux.c
index fb1153b..f19f0c4 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -441,10 +441,6 @@
int ret;
aurb = async_alloc();
- if (!aurb) {
- dprintf("husb: async malloc failed\n");
- return USB_RET_NAK;
- }
aurb->hdev = s;
aurb->packet = p;
@@ -585,10 +581,6 @@
/* The rest are asynchronous */
aurb = async_alloc();
- if (!aurb) {
- dprintf("husb: async malloc failed\n");
- return USB_RET_NAK;
- }
aurb->hdev = s;
aurb->packet = p;
@@ -898,8 +890,6 @@
char buf[1024];
dev = qemu_mallocz(sizeof(USBHostDevice));
- if (!dev)
- goto fail;
dev->bus_num = bus_num;
dev->addr = addr;
@@ -1308,14 +1298,8 @@
/* the module setting (used later for opening devices) */
usb_host_device_path = qemu_mallocz(strlen(devpath)+1);
- if (usb_host_device_path) {
- strcpy(usb_host_device_path, devpath);
- term_printf("husb: using %s file-system with %s\n", fs_type[usb_fs_type], usb_host_device_path);
- } else {
- /* out of memory? */
- perror("husb: unable to allocate memory for device path");
- return -ENOMEM;
- }
+ strcpy(usb_host_device_path, devpath);
+ term_printf("husb: using %s file-system with %s\n", fs_type[usb_fs_type], usb_host_device_path);
}
switch (usb_fs_type) {
@@ -1455,10 +1439,6 @@
return -1;
f = qemu_mallocz(sizeof(*f));
- if (!f) {
- fprintf(stderr, "husb: failed to allocate auto filter\n");
- return -1;
- }
*f = filter;