> -----Original Message----- > From: Gerd Hoffmann [mailto:kra...@redhat.com] > Sent: Monday, June 02, 2014 3:45 PM > To: Gonglei (Arei) > Cc: qemu-devel@nongnu.org; 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