Skip to content

Commit

Permalink
USB: ohci_usb can oops on shutdown
Browse files Browse the repository at this point in the history
When ohci-hcd is shutting down (for rmmod or PC-card removal), there is
a window when the device is shut down, HC communication area (->hcca)
is freed, but the core has not called "free_irq" yet. If another device
triggers a shared interrupt in this window, we oops when trying to
access the freed ->hcca.

This patch removes the window by calling free_irq before ->hcca is freed.

The patch is tested at the PC hotplug test rig at Stratus, and with
rmmod by Rafael Wysocki.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 38e2bfc commit 71795c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/host/ohci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,9 @@ static void ohci_stop (struct usb_hcd *hcd)

ohci_usb_reset (ohci);
ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);

free_irq(hcd->irq, hcd);
hcd->irq = -1;

remove_debug_files (ohci);
ohci_mem_cleanup (ohci);
if (ohci->hcca) {
Expand Down

0 comments on commit 71795c1

Please sign in to comment.