Index: uspace/lib/usbdev/include/usb/dev/device.h
===================================================================
--- uspace/lib/usbdev/include/usb/dev/device.h	(revision 1ed3eb446a3e26cd5f83359306aa7e05b1fc14ad)
+++ uspace/lib/usbdev/include/usb/dev/device.h	(revision 24893533ca9ec3767255a61462aa42d05039d4ea)
@@ -88,4 +88,5 @@
 usb_endpoint_mapping_t * usb_device_get_mapped_ep(usb_device_t *,
     usb_endpoint_t);
+int usb_device_unmap_ep(usb_endpoint_mapping_t *);
 
 int usb_device_get_iface_number(usb_device_t *);
Index: uspace/lib/usbdev/src/devdrv.c
===================================================================
--- uspace/lib/usbdev/src/devdrv.c	(revision 1ed3eb446a3e26cd5f83359306aa7e05b1fc14ad)
+++ uspace/lib/usbdev/src/devdrv.c	(revision 24893533ca9ec3767255a61462aa42d05039d4ea)
@@ -48,4 +48,5 @@
 #include <devman.h>
 #include <errno.h>
+#include <str_error.h>
 #include <stdlib.h>
 
@@ -299,9 +300,12 @@
 
 	/* Destroy the pipes. */
+	int rc;
 	for (size_t i = 0; i < usb_dev->pipes_count; ++i) {
 		usb_log_debug2("Unregistering pipe %zu: %spresent.\n",
 		    i, usb_dev->pipes[i].present ? "" : "not ");
-		if (usb_dev->pipes[i].present)
-			usb_pipe_unregister(&usb_dev->pipes[i].pipe);
+
+		rc = usb_device_unmap_ep(usb_dev->pipes + i);
+		if (rc != EOK && rc != ENOENT)
+			usb_log_warning("Unregistering pipe %zu failed: %s", i, str_error(rc));
 	}
 
@@ -337,4 +341,19 @@
 	}
 	return NULL;
+}
+
+int usb_device_unmap_ep(usb_endpoint_mapping_t *epm)
+{
+	assert(epm);
+
+	if (!epm->present)
+		return ENOENT;
+
+	const int rc = usb_pipe_unregister(&epm->pipe);
+	if (rc != EOK)
+		return rc;
+
+	epm->present = false;
+	return EOK;
 }
 
