diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-07-27 15:04:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-28 17:31:12 -0400 |
commit | b7d6d99896a6cf38dc354d673afd3fbde10b86c2 (patch) | |
tree | d408bad39ad67314b99a0d7a77c197d70fbfa550 /drivers/usb/host/xhci-mem.c | |
parent | 4a73143ced467868e92d7914d9f8bf797640927b (diff) |
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/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 7 |
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, | |||
496 | max_packet = ep->desc.wMaxPacketSize; | 496 | max_packet = ep->desc.wMaxPacketSize; |
497 | ep_ctx->ep_info2 |= MAX_PACKET(max_packet); | 497 | ep_ctx->ep_info2 |= MAX_PACKET(max_packet); |
498 | /* dig out max burst from ep companion desc */ | 498 | /* dig out max burst from ep companion desc */ |
499 | max_packet = ep->ss_ep_comp->desc.bMaxBurst; | 499 | if (!ep->ss_ep_comp) { |
500 | xhci_warn(xhci, "WARN no SS endpoint companion descriptor.\n"); | ||
501 | max_packet = 0; | ||
502 | } else { | ||
503 | max_packet = ep->ss_ep_comp->desc.bMaxBurst; | ||
504 | } | ||
500 | ep_ctx->ep_info2 |= MAX_BURST(max_packet); | 505 | ep_ctx->ep_info2 |= MAX_BURST(max_packet); |
501 | break; | 506 | break; |
502 | case USB_SPEED_HIGH: | 507 | case USB_SPEED_HIGH: |