[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function |
Date: |
Tue, 3 Jun 2014 01:40:55 +0000 |
> -----Original Message-----
> From: Gerd Hoffmann [mailto:address@hidden
> Sent: Monday, June 02, 2014 3:45 PM
> To: Gonglei (Arei)
> Cc: address@hidden; Luonengjun; Huangweidong (C); Huangpeng
> (Peter)
> Subject: Re: [PATCH 2/6] usb-ohci: add exit function
>
> Hi,
>
> > +static void usb_ohci_exit(PCIDevice *dev)
> > +{
> > + OHCIPCIState *ohci = PCI_OHCI(dev);
> > + OHCIState *s = &ohci->state;
> > +
> > + memory_region_destroy(&s->mem);
> > +
> > + if (!ohci->masterbus) {
> > + usb_bus_release(&s->bus);
> > + }
> > +}
>
> This is incomplete. At minimum you have to care about s->eof_timer.
>
Agreed.
> Same goes for the other host adapters. There can be timers running and
> there might be in-flight usb requests which must be property teared
> down, to make sure we don't use-after-free hostadapter state in
> callbacks.
>
I will check and complete them. Thanks.
Best regards,
-Gonglei