Index: uspace/drv/bus/usb/xhci/hc.c
===================================================================
--- uspace/drv/bus/usb/xhci/hc.c	(revision e439f46861706be55b5ae3dec82cfd42d38f5cf5)
+++ uspace/drv/bus/usb/xhci/hc.c	(revision 706a3e25d1bafdf27a7578f3fffa1e06ccd666f9)
@@ -483,9 +483,21 @@
 static void hc_dcbaa_fini(xhci_hc_t *hc)
 {
+	xhci_trb_ring_t* trb_ring;
 	xhci_scratchpad_free(hc);
 
 	/* Idx 0 already deallocated by xhci_scratchpad_free. */
 	for (unsigned i = 1; i < hc->max_slots + 1; ++i) {
-		if (hc->dcbaa_virt[i] != NULL) {
+		if (hc->dcbaa_virt[i]) {
+			if (hc->dcbaa_virt[i]->dev_ctx)
+				free32(hc->dcbaa_virt[i]->dev_ctx);
+
+			for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) {
+				trb_ring = hc->dcbaa_virt[i]->trs[i];
+				if (trb_ring) {
+					xhci_trb_ring_fini(trb_ring);
+					free32(trb_ring);
+				}
+			}
+
 			free32(hc->dcbaa_virt[i]);
 			hc->dcbaa_virt[i] = NULL;
Index: uspace/drv/bus/usb/xhci/hc.h
===================================================================
--- uspace/drv/bus/usb/xhci/hc.h	(revision e439f46861706be55b5ae3dec82cfd42d38f5cf5)
+++ uspace/drv/bus/usb/xhci/hc.h	(revision 706a3e25d1bafdf27a7578f3fffa1e06ccd666f9)
@@ -43,4 +43,9 @@
 #include "trb_ring.h"
 
+typedef struct xhci_virt_device_ctx {
+    xhci_device_ctx_t *dev_ctx;
+    xhci_trb_ring_t *trs[XHCI_EP_COUNT];
+} xhci_virt_device_ctx_t;
+
 /**
  * xHCI lets the controller define speeds of ports it controls.
@@ -67,5 +72,5 @@
 	xhci_event_ring_t event_ring;
 	uint64_t *dcbaa;
-	xhci_device_ctx_t **dcbaa_virt;
+	xhci_virt_device_ctx_t **dcbaa_virt;
 	xhci_scratchpad_t *scratchpad;
 
Index: uspace/drv/bus/usb/xhci/hw_struct/context.h
===================================================================
--- uspace/drv/bus/usb/xhci/hw_struct/context.h	(revision e439f46861706be55b5ae3dec82cfd42d38f5cf5)
+++ uspace/drv/bus/usb/xhci/hw_struct/context.h	(revision 706a3e25d1bafdf27a7578f3fffa1e06ccd666f9)
@@ -51,4 +51,6 @@
 	xhci_dword_t data[5];
 	xhci_dword_t reserved[3];
+
+#define XHCI_EP_COUNT 31
 
 #define XHCI_EP_TYPE_ISOCH_OUT		1
@@ -132,5 +134,5 @@
 typedef struct xhci_device_ctx {
 	xhci_slot_ctx_t slot_ctx;
-	xhci_ep_ctx_t endpoint_ctx [31];
+	xhci_ep_ctx_t endpoint_ctx[XHCI_EP_COUNT];
 } __attribute__((packed)) xhci_device_ctx_t;
 
@@ -165,5 +167,5 @@
 
 #define XHCI_INPUT_CTRL_CTX_ADD_SET(ctx, idx) (ctx).data[1] |= (1 << (idx))
-    
+
 #define XHCI_INPUT_CTRL_CTX_CONFIG_VALUE(ctx)   XHCI_DWORD_EXTRACT((ctx).data[7],  7,  0)
 #define XHCI_INPUT_CTRL_CTX_IFACE_NUMBER(ctx)   XHCI_DWORD_EXTRACT((ctx).data[7], 15,  8)
@@ -177,5 +179,5 @@
 	xhci_input_ctrl_ctx_t ctrl_ctx;
 	xhci_slot_ctx_t slot_ctx;
-	xhci_ep_ctx_t endpoint_ctx [31];
+	xhci_ep_ctx_t endpoint_ctx[XHCI_EP_COUNT];
 } __attribute__((packed)) xhci_input_ctx_t;
 
Index: uspace/drv/bus/usb/xhci/rh.c
===================================================================
--- uspace/drv/bus/usb/xhci/rh.c	(revision e439f46861706be55b5ae3dec82cfd42d38f5cf5)
+++ uspace/drv/bus/usb/xhci/rh.c	(revision 706a3e25d1bafdf27a7578f3fffa1e06ccd666f9)
@@ -115,5 +115,5 @@
 
 	hc->dcbaa[slot_id] = addr_to_phys(dctx);
-	hc->dcbaa_virt[slot_id] = dctx;
+	hc->dcbaa_virt[slot_id]->dev_ctx = dctx;
 
 	cmd = xhci_alloc_command();
