aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2006-09-19 01:57:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:59:00 -0400
commit71795c1df30b034414c921b4930ed88de34ca348 (patch)
tree962dc749e8d56bb90d9b40c2401d6519eca8f630 /drivers/usb
parent38e2bfc94e95dd6005fdaf40dfec0157396741da (diff)
USB: ohci_usb can oops on shutdown
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ohci-hcd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 2c614af8f733..1027aa04583d 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -795,7 +795,9 @@ static void ohci_stop (struct usb_hcd *hcd)
795 795
796 ohci_usb_reset (ohci); 796 ohci_usb_reset (ohci);
797 ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); 797 ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
798 798 free_irq(hcd->irq, hcd);
799 hcd->irq = -1;
800
799 remove_debug_files (ohci); 801 remove_debug_files (ohci);
800 ohci_mem_cleanup (ohci); 802 ohci_mem_cleanup (ohci);
801 if (ohci->hcca) { 803 if (ohci->hcca) {