Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7d6d998 authored by Sarah Sharp's avatar Sarah Sharp Committed by Greg Kroah-Hartman
Browse files

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: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4a73143c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 */
		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: