mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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
This commit is contained in:
parent
0d0266a53b
commit
1eec614b36
25 changed files with 25 additions and 254 deletions
24
usb-linux.c
24
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue