From 1eec614b36390be66430ed6dd0ce47a6f2f0ae1a Mon Sep 17 00:00:00 2001 From: aliguori Date: Thu, 5 Feb 2009 22:06:18 +0000 Subject: toplevel: remove error handling from qemu_malloc() callers (Avi Kivity) Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162 --- usb-linux.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'usb-linux.c') 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; -- cgit v1.2.1