Revision 059809e4 hw/usb-hub.c

b/hw/usb-hub.c
199 199
    }
200 200
}
201 201

  
202
static void usb_hub_handle_reset(USBDevice *dev, int destroy)
202
static void usb_hub_handle_reset(USBDevice *dev)
203 203
{
204 204
    /* XXX: do it */
205
    if (destroy)
206
        qemu_free(dev);
207 205
}
208 206

  
209 207
static int usb_hub_handle_control(USBDevice *dev, int request, int value,
......
525 523
    return usb_generic_handle_packet(dev, pid, devaddr, devep, data, len);
526 524
}
527 525

  
526
static void usb_hub_handle_destroy(USBDevice *dev)
527
{
528
    USBHubState *s = (USBHubState *)dev;
529

  
530
    qemu_free(s);
531
}
532

  
528 533
USBDevice *usb_hub_init(int nb_ports)
529 534
{
530 535
    USBHubState *s;
......
543 548
    s->dev.handle_reset = usb_hub_handle_reset;
544 549
    s->dev.handle_control = usb_hub_handle_control;
545 550
    s->dev.handle_data = usb_hub_handle_data;
551
    s->dev.handle_destroy = usb_hub_handle_destroy;
546 552

  
547 553
    pstrcpy(s->dev.devname, sizeof(s->dev.devname), "QEMU USB Hub");
548 554

  

Also available in: Unified diff