Revision 7267c094 usb-linux.c

b/usb-linux.c
271 271

  
272 272
static AsyncURB *async_alloc(USBHostDevice *s)
273 273
{
274
    AsyncURB *aurb = qemu_mallocz(sizeof(AsyncURB));
274
    AsyncURB *aurb = g_malloc0(sizeof(AsyncURB));
275 275
    aurb->hdev = s;
276 276
    QLIST_INSERT_HEAD(&s->aurbs, aurb, next);
277 277
    return aurb;
......
280 280
static void async_free(AsyncURB *aurb)
281 281
{
282 282
    QLIST_REMOVE(aurb, next);
283
    qemu_free(aurb);
283
    g_free(aurb);
284 284
}
285 285

  
286 286
static void do_disconnect(USBHostDevice *s)
......
528 528
    AsyncURB *aurb;
529 529
    int i, j, len = get_max_packet_size(s, ep);
530 530

  
531
    aurb = qemu_mallocz(s->iso_urb_count * sizeof(*aurb));
531
    aurb = g_malloc0(s->iso_urb_count * sizeof(*aurb));
532 532
    for (i = 0; i < s->iso_urb_count; i++) {
533 533
        aurb[i].urb.endpoint      = ep;
534 534
        aurb[i].urb.buffer_length = ISO_FRAME_DESC_PER_URB * len;
535
        aurb[i].urb.buffer        = qemu_malloc(aurb[i].urb.buffer_length);
535
        aurb[i].urb.buffer        = g_malloc(aurb[i].urb.buffer_length);
536 536
        aurb[i].urb.type          = USBDEVFS_URB_TYPE_ISO;
537 537
        aurb[i].urb.flags         = USBDEVFS_URB_ISO_ASAP;
538 538
        aurb[i].urb.number_of_packets = ISO_FRAME_DESC_PER_URB;
......
578 578
    }
579 579

  
580 580
    for (i = 0; i < s->iso_urb_count; i++) {
581
        qemu_free(aurb[i].urb.buffer);
581
        g_free(aurb[i].urb.buffer);
582 582
    }
583 583

  
584 584
    if (free)
585
        qemu_free(aurb);
585
        g_free(aurb);
586 586
    else
587 587
        printf("husb: leaking iso urbs because of discard failure\n");
588 588
    set_iso_urb(s, ep, NULL);
......
1688 1688
        }
1689 1689

  
1690 1690
        /* the module setting (used later for opening devices) */
1691
        usb_host_device_path = qemu_mallocz(strlen(devpath)+1);
1691
        usb_host_device_path = g_malloc0(strlen(devpath)+1);
1692 1692
        strcpy(usb_host_device_path, devpath);
1693 1693
        if (mon) {
1694 1694
            monitor_printf(mon, "husb: using %s file-system with %s\n",

Also available in: Unified diff