Index: uspace/lib/usbhost/include/usb/host/endpoint.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/endpoint.h	(revision 94a0904eeac0644e7f048249bd272198d23ee400)
+++ uspace/lib/usbhost/include/usb/host/endpoint.h	(revision 97483360f37b1571fde54dc9aa65eb57fc07407f)
@@ -116,5 +116,6 @@
 static inline bus_t *endpoint_get_bus(endpoint_t *ep)
 {
-	return ep->device->bus;
+	device_t * const device = ep->device;
+	return device ? device->bus : NULL;
 }
 
Index: uspace/lib/usbhost/src/endpoint.c
===================================================================
--- uspace/lib/usbhost/src/endpoint.c	(revision 94a0904eeac0644e7f048249bd272198d23ee400)
+++ uspace/lib/usbhost/src/endpoint.c	(revision 97483360f37b1571fde54dc9aa65eb57fc07407f)
@@ -248,6 +248,11 @@
 	    name, target.address, target.endpoint, size, ep->max_packet_size);
 
-	bus_t *bus = endpoint_get_bus(ep);
-	const bus_ops_t *ops = BUS_OPS_LOOKUP(bus->ops, batch_schedule);
+	device_t * const device = ep->device;
+	if (!device) {
+		usb_log_warning("Endpoint detached");
+		return EAGAIN;
+	}
+
+	const bus_ops_t *ops = BUS_OPS_LOOKUP(device->bus->ops, batch_schedule);
 	if (!ops) {
 		usb_log_error("HCD does not implement scheduler.\n");
@@ -256,5 +261,5 @@
 
 	/* Offline devices don't schedule transfers other than on EP0. */
-	if (!ep->device->online && ep->endpoint > 0) {
+	if (!device->online && ep->endpoint > 0) {
 		return EAGAIN;
 	}
@@ -265,5 +270,5 @@
 		usb_log_error("Endpoint(%d:%d) %s needs %zu bw "
 		    "but only %zu is reserved.\n",
-		    ep->device->address, ep->endpoint, name, bw, ep->bandwidth);
+		    device->address, ep->endpoint, name, bw, ep->bandwidth);
 		return ENOSPC;
 	}
