From: Gerd Hoffmann <kraxel@redhat.com>
To: arei.gonglei@huawei.com
Cc: weidong.huang@huawei.com, luonengjun@huawei.com,
qemu-devel@nongnu.org, peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function
Date: Mon, 02 Jun 2014 09:45:27 +0200 [thread overview]
Message-ID: <1401695127.22391.17.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <1401452542-11080-3-git-send-email-arei.gonglei@huawei.com>
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
next prev parent reply other threads:[~2014-06-02 7:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1401452542-11080-1-git-send-email-arei.gonglei@huawei.com>
[not found] ` <1401452542-11080-2-git-send-email-arei.gonglei@huawei.com>
2014-06-02 7:36 ` [Qemu-devel] [PATCH 1/6] usb: add usb_bus_release function Gerd Hoffmann
2014-06-03 1:21 ` Gonglei (Arei)
[not found] ` <1401452542-11080-3-git-send-email-arei.gonglei@huawei.com>
2014-06-02 7:45 ` Gerd Hoffmann [this message]
2014-06-03 1:40 ` [Qemu-devel] [PATCH 2/6] usb-ohci: add exit function Gonglei (Arei)
[not found] ` <1401452542-11080-7-git-send-email-arei.gonglei@huawei.com>
2014-06-02 7:58 ` [Qemu-devel] [PATCH 6/6] usb: tag usb host controller as hotpluggable Gerd Hoffmann
2014-06-02 10:49 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1401695127.22391.17.camel@nilsson.home.kraxel.org \
--to=kraxel@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=luonengjun@huawei.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=weidong.huang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).