Index: uspace/drv/bus/usb/xhci/endpoint.c
===================================================================
--- uspace/drv/bus/usb/xhci/endpoint.c	(revision 2b6194515b4a1d9d4ac636869626fc887b61cc4f)
+++ uspace/drv/bus/usb/xhci/endpoint.c	(revision 2e5aea1793c59721de23e0320a1e7f8f2aebc260)
@@ -183,5 +183,5 @@
 
 	int err = ENOMEM;
-	usb_endpoint_t ep_num = ep->base.target.endpoint;
+	const usb_endpoint_t ep_num = ep->base.target.endpoint;
 
 	assert(&dev->base == ep->base.device);
@@ -203,4 +203,5 @@
 	// Prepare input context.
 	xhci_input_ctx_t *ictx = malloc32(sizeof(xhci_input_ctx_t));
+	const unsigned ep_idx = xhci_endpoint_index(ep);
 	if (!ictx)
 		goto err;
@@ -213,6 +214,4 @@
 	XHCI_INPUT_CTRL_CTX_DROP_CLEAR(ictx->ctrl_ctx, 1);
 	XHCI_INPUT_CTRL_CTX_ADD_SET(ictx->ctrl_ctx, 0);
-
-	unsigned ep_idx = xhci_endpoint_index(ep);
 	XHCI_INPUT_CTRL_CTX_ADD_SET(ictx->ctrl_ctx, ep_idx + 1); /* Preceded by slot ctx */
 
