Index: uspace/drv/bus/usb/xhci/commands.c
===================================================================
--- uspace/drv/bus/usb/xhci/commands.c	(revision a06fd64032f04d90ea9522e695c22b49ca90838b)
+++ uspace/drv/bus/usb/xhci/commands.c	(revision c4d4fa22e22addc7ec1a5319999735e047b11c3b)
@@ -52,5 +52,5 @@
 }
 
-int xhci_wait_for_command(xhci_hc_t *hc, xhci_cmd_t *cmd, uint32_t timeout)
+int xhci_wait_for_command(xhci_cmd_t *cmd, uint32_t timeout)
 {
 	uint32_t time = 0;
@@ -85,7 +85,8 @@
 void xhci_free_command(xhci_cmd_t *cmd)
 {
-	// TODO: If we decide to copy trb, free it here.
 	if (cmd->ictx)
 		free32(cmd->ictx);
+	if (cmd->trb)
+		free32(cmd->trb);
 
 	free32(cmd);
@@ -382,6 +383,4 @@
 {
 	// TODO: Update dequeue ptrs.
-	// TODO: Possibly clone command trb, as it may get overwritten before
-	//       it is processed (if somebody polls the command completion).
 	assert(hc);
 	assert(trb);
@@ -393,8 +392,4 @@
 	xhci_cmd_t *command;
 	xhci_trb_t *command_trb;
-
-	code = XHCI_DWORD_EXTRACT(trb->status, 31, 24);
-	slot_id = XHCI_DWORD_EXTRACT(trb->control, 31, 24);
-	(void) slot_id;
 
 	command = get_next_command(hc);
@@ -451,6 +446,11 @@
 	command->completed = true;
 
-	if (!command->has_owner)
+	if (!command->has_owner) {
 		xhci_free_command(command);
+	} else {
+		/* Copy the trb for later use so that we can free space on the cmd ring. */
+		command->trb = malloc32(sizeof(xhci_trb_t));
+		xhci_trb_copy(command->trb, command_trb);
+	}
 
 	return EOK;
Index: uspace/drv/bus/usb/xhci/commands.h
===================================================================
--- uspace/drv/bus/usb/xhci/commands.h	(revision a06fd64032f04d90ea9522e695c22b49ca90838b)
+++ uspace/drv/bus/usb/xhci/commands.h	(revision c4d4fa22e22addc7ec1a5319999735e047b11c3b)
@@ -57,5 +57,5 @@
 
 int xhci_init_commands(xhci_hc_t *);
-int xhci_wait_for_command(xhci_hc_t *, xhci_cmd_t *, uint32_t);
+int xhci_wait_for_command(xhci_cmd_t *, uint32_t);
 xhci_cmd_t *xhci_alloc_command(void);
 void xhci_free_command(xhci_cmd_t *);
