Index: uspace/drv/bus/usb/xhci/endpoint.c
===================================================================
--- uspace/drv/bus/usb/xhci/endpoint.c	(revision 82fe063c35474ab699219a716a8e711561778404)
+++ uspace/drv/bus/usb/xhci/endpoint.c	(revision 81487c4a97e762fee2b77d428ca04d094c33dc25)
@@ -64,15 +64,33 @@
 }
 
+static bool endpoint_uses_streams(xhci_endpoint_t *xhci_ep)
+{
+	return xhci_ep->base.transfer_type == USB_TRANSFER_BULK
+	    && xhci_ep->max_streams;
+}
+
+static size_t primary_stream_ctx_array_size(xhci_endpoint_t *xhci_ep)
+{
+	if (!endpoint_uses_streams(xhci_ep))
+		return 0;
+
+	/* Section 6.2.3, Table 61 */
+	return 1 << (xhci_ep->max_streams + 1);
+}
+
 int xhci_endpoint_alloc_transfer_ds(xhci_endpoint_t *xhci_ep)
 {
 	int err;
 
-	if (xhci_ep->max_streams > 0) {
-		// Set up primary stream context array if needed.
-		xhci_ep->primary_stream_ctx_array = malloc32(xhci_ep->max_streams * sizeof(xhci_stream_ctx_t));
+	if (endpoint_uses_streams(xhci_ep)) {
+		/* Set up primary stream context array if needed. */
+		const size_t size = primary_stream_ctx_array_size(xhci_ep);
+
+		xhci_ep->primary_stream_ctx_array = malloc32(size * sizeof(xhci_stream_ctx_t));
 		if (!xhci_ep->primary_stream_ctx_array) {
 			return ENOMEM;
 		}
-		memset(xhci_ep->primary_stream_ctx_array, 0, xhci_ep->max_streams * sizeof(xhci_stream_ctx_t));
+
+		memset(xhci_ep->primary_stream_ctx_array, 0, size * sizeof(xhci_stream_ctx_t));
 	} else {
 		xhci_ep->primary_stream_ctx_array = NULL;
@@ -89,5 +107,5 @@
 	int err;
 
-	if (xhci_ep->max_streams > 0) {
+	if (endpoint_uses_streams(xhci_ep)) {
 		// TODO: What about secondaries?
 		free32(xhci_ep->primary_stream_ctx_array);
@@ -169,5 +187,5 @@
 	XHCI_EP_ERROR_COUNT_SET(*ctx, 3);
 
-	if (ep->max_streams > 0) {
+	if (endpoint_uses_streams(ep)) {
 		XHCI_EP_MAX_P_STREAMS_SET(*ctx, ep->max_streams);
 		XHCI_EP_TR_DPTR_SET(*ctx, addr_to_phys(ep->primary_stream_ctx_array));
Index: uspace/drv/bus/usb/xhci/endpoint.h
===================================================================
--- uspace/drv/bus/usb/xhci/endpoint.h	(revision 82fe063c35474ab699219a716a8e711561778404)
+++ uspace/drv/bus/usb/xhci/endpoint.h	(revision 81487c4a97e762fee2b77d428ca04d094c33dc25)
@@ -76,5 +76,5 @@
 	xhci_stream_ctx_t *primary_stream_ctx_array;
 
-	/** Maximum number of primary streams (0-16), also a valid range of PSCA above */
+	/** 2-log of maximum number of primary streams (0-16). Not to be used directly. */
 	uint8_t max_streams;
 
