Skip to content

Commit

Permalink
USB: xhci: Fail gracefully if there's no SS ep companion descriptor.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sarah Sharp authored and Greg Kroah-Hartman committed Jul 28, 2009
1 parent 4a73143 commit b7d6d99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/usb/host/xhci-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b7d6d99

Please sign in to comment.