summaryrefslogtreecommitdiff
path: root/usb-linux.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:06:18 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:06:18 +0000
commit1eec614b36390be66430ed6dd0ce47a6f2f0ae1a (patch)
treefa9174028d54ea9a531a77d05996688fc704fadd /usb-linux.c
parent0d0266a53b4c80ab08c093c36bb3a7bbb29cc3e5 (diff)
downloadqemu-1eec614b36390be66430ed6dd0ce47a6f2f0ae1a.tar.gz
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
Diffstat (limited to 'usb-linux.c')
-rw-r--r--usb-linux.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/usb-linux.c b/usb-linux.c
index fb1153bbd4..f19f0c4107 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -441,10 +441,6 @@ static int usb_host_handle_data(USBHostDevice *s, USBPacket *p)
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 @@ static int usb_host_handle_control(USBHostDevice *s, USBPacket *p)
/* 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 @@ static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *p
char buf[1024];
dev = qemu_mallocz(sizeof(USBHostDevice));
- if (!dev)
- goto fail;
dev->bus_num = bus_num;
dev->addr = addr;
@@ -1308,14 +1298,8 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)
/* 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 @@ static int usb_host_auto_add(const char *spec)
return -1;
f = qemu_mallocz(sizeof(*f));
- if (!f) {
- fprintf(stderr, "husb: failed to allocate auto filter\n");
- return -1;
- }
*f = filter;