[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function |
Date: |
Mon, 02 Jun 2014 09:45:27 +0200 |
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.
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.
cheers,
Gerd
- Re: [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function,
Gerd Hoffmann <=