Revision 1eec614b usb-linux.c
b/usb-linux.c | ||
---|---|---|
441 | 441 |
int ret; |
442 | 442 |
|
443 | 443 |
aurb = async_alloc(); |
444 |
if (!aurb) { |
|
445 |
dprintf("husb: async malloc failed\n"); |
|
446 |
return USB_RET_NAK; |
|
447 |
} |
|
448 | 444 |
aurb->hdev = s; |
449 | 445 |
aurb->packet = p; |
450 | 446 |
|
... | ... | |
585 | 581 |
/* The rest are asynchronous */ |
586 | 582 |
|
587 | 583 |
aurb = async_alloc(); |
588 |
if (!aurb) { |
|
589 |
dprintf("husb: async malloc failed\n"); |
|
590 |
return USB_RET_NAK; |
|
591 |
} |
|
592 | 584 |
aurb->hdev = s; |
593 | 585 |
aurb->packet = p; |
594 | 586 |
|
... | ... | |
898 | 890 |
char buf[1024]; |
899 | 891 |
|
900 | 892 |
dev = qemu_mallocz(sizeof(USBHostDevice)); |
901 |
if (!dev) |
|
902 |
goto fail; |
|
903 | 893 |
|
904 | 894 |
dev->bus_num = bus_num; |
905 | 895 |
dev->addr = addr; |
... | ... | |
1308 | 1298 |
|
1309 | 1299 |
/* the module setting (used later for opening devices) */ |
1310 | 1300 |
usb_host_device_path = qemu_mallocz(strlen(devpath)+1); |
1311 |
if (usb_host_device_path) { |
|
1312 |
strcpy(usb_host_device_path, devpath); |
|
1313 |
term_printf("husb: using %s file-system with %s\n", fs_type[usb_fs_type], usb_host_device_path); |
|
1314 |
} else { |
|
1315 |
/* out of memory? */ |
|
1316 |
perror("husb: unable to allocate memory for device path"); |
|
1317 |
return -ENOMEM; |
|
1318 |
} |
|
1301 |
strcpy(usb_host_device_path, devpath); |
|
1302 |
term_printf("husb: using %s file-system with %s\n", fs_type[usb_fs_type], usb_host_device_path); |
|
1319 | 1303 |
} |
1320 | 1304 |
|
1321 | 1305 |
switch (usb_fs_type) { |
... | ... | |
1455 | 1439 |
return -1; |
1456 | 1440 |
|
1457 | 1441 |
f = qemu_mallocz(sizeof(*f)); |
1458 |
if (!f) { |
|
1459 |
fprintf(stderr, "husb: failed to allocate auto filter\n"); |
|
1460 |
return -1; |
|
1461 |
} |
|
1462 | 1442 |
|
1463 | 1443 |
*f = filter; |
1464 | 1444 |
|
Also available in: Unified diff