summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSarah Sharp2009-07-27 21:04:38 +0200
committerGreg Kroah-Hartman2009-07-28 23:31:12 +0200
commitb7d6d99896a6cf38dc354d673afd3fbde10b86c2 (patch)
treed408bad39ad67314b99a0d7a77c197d70fbfa550 /drivers/usb
parentUSB: xhci: Handle babble errors on transfers. (diff)
downloadkernel-qcow2-linux-b7d6d99896a6cf38dc354d673afd3fbde10b86c2.tar.gz
kernel-qcow2-linux-b7d6d99896a6cf38dc354d673afd3fbde10b86c2.tar.xz
kernel-qcow2-linux-b7d6d99896a6cf38dc354d673afd3fbde10b86c2.zip
USB: xhci: Fail gracefully if there's no SS ep companion descriptor.
This is a work around for a bug in the SuperSpeed Endpoint Companion Descriptor parsing code. It fails in some corner cases, which means ep->ss_ep_comp may be NULL. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/xhci-mem.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 075e1036bcb4..41aca003ee82 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -496,7 +496,12 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
max_packet = ep->desc.wMaxPacketSize;
ep_ctx->ep_info2 |= MAX_PACKET(max_packet);
/* dig out max burst from ep companion desc */
- max_packet = ep->ss_ep_comp->desc.bMaxBurst;
+ if (!ep->ss_ep_comp) {
+ xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n");
+ max_packet = 0;
+ } else {
+ max_packet = ep->ss_ep_comp->desc.bMaxBurst;
+ }
ep_ctx->ep_info2 |= MAX_BURST(max_packet);
break;
case USB_SPEED_HIGH: