Index: uspace/lib/usbhost/src/bus.c
===================================================================
--- uspace/lib/usbhost/src/bus.c	(revision f3ae58b5c7e604cb94bfc012cca168ac37d183c4)
+++ uspace/lib/usbhost/src/bus.c	(revision 1bab1c8792534785c46d223f7930181efe68225a)
@@ -173,11 +173,17 @@
 		endpoint_t * const ep = dev->endpoints[i];
 		endpoint_add_ref(ep);
-		
+
 		fibril_mutex_unlock(&dev->guard);
-		bus_endpoint_remove(ep);
+		const int err = bus_endpoint_remove(ep);
+		if (err)
+			usb_log_warning("Endpoint %u cannot be removed. "
+			    "Some deffered cleanup was faster?", ep->endpoint);
+
+		endpoint_del_ref(ep);
 		fibril_mutex_lock(&dev->guard);
-
+	}
+
+	for (usb_endpoint_t i = 1; i < USB_ENDPOINT_MAX; ++i)
 		assert(dev->endpoints[i] == NULL);
-	}
 
 	/* Remove also orphaned children. */
@@ -185,6 +191,12 @@
 		device_t * const child = list_get_instance(list_first(&dev->devices), device_t, link);
 
-		usb_log_warning("USB device '%s' driver left device '%s' behind after %s.",
+		/*
+		 * This is not an error condition, as devices cannot remove
+		 * their children devices while they are removed, because for
+		 * DDF, they are siblings.
+		 */
+		usb_log_debug("USB device '%s' driver left device '%s' behind after %s.",
 		    ddf_fun_get_name(dev->fun), ddf_fun_get_name(child->fun), op);
+
 		/*
 		 * The child node won't disappear, because its parent's driver
@@ -463,5 +475,5 @@
 
 /**
- * Remove an endpoint from the device. Consumes a reference.
+ * Remove an endpoint from the device.
  */
 int bus_endpoint_remove(endpoint_t *ep)
@@ -491,4 +503,11 @@
 
 	fibril_mutex_lock(&device->guard);
+
+	/* Check whether the endpoint is registered */
+	if (device->endpoints[idx] != ep) {
+		fibril_mutex_unlock(&device->guard);
+		return EINVAL;
+	}
+
 	bus->ops->endpoint_unregister(ep);
 	device->endpoints[idx] = NULL;
@@ -496,7 +515,4 @@
 
 	/* Bus reference */
-	endpoint_del_ref(ep);
-
-	/* Given reference */
 	endpoint_del_ref(ep);
 
