summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Pham <jackp@codeaurora.org>2013-11-15 22:53:14 +0000
committerThomas Cherry <tcherry@nvidia.com>2014-02-05 15:40:31 -0800
commit788aa1d436954f81df8025a70ba8cc01f546648b (patch)
tree40d5e5184e2e106c2c52d3b6021bf942ba249745
parente0723445676f12ef8059802db4c94a0f43a446a5 (diff)
usb: xhci: Check for XHCI_PLAT in xhci_cleanup_msix()
If CONFIG_PCI is enabled, make sure xhci_cleanup_msix() doesn't try to free a bogus PCI IRQ or dereference an invalid pci_dev when the xHCI device is actually a platform_device. This patch should be backported to kernels as old as 3.9, that contain the commit 52fb61250a7a132b0cfb9f4a1060a1f3c49e5a25 "xhci-plat: Don't enable legacy PCI interrupts." Cc: stable@vger.kernel.org Change-Id: I6601c3db7a0a4f5ebef6c64118eb62a67701c42a Reviewed-on: http://git-master/r/358200 Signed-off-by: Jack Pham <jackp@codeaurora.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Reviewed-on: http://git-master/r/361700 Reviewed-by: Thomas Cherry <tcherry@nvidia.com> Tested-by: Thomas Cherry <tcherry@nvidia.com>
-rw-r--r--drivers/usb/host/xhci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ad0f037c4ae0..1b62ee320008 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -315,6 +315,9 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
struct usb_hcd *hcd = xhci_to_hcd(xhci);
struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
+ if (xhci->quirks & XHCI_PLAT)
+ return;
+
xhci_free_irq(xhci);
if (xhci->msix_entries) {