Index: uspace/drv/bus/usb/uhcirh/port.c
===================================================================
--- uspace/drv/bus/usb/uhcirh/port.c	(revision b5111c46021cac567ff85e5ffa9f39811311f805)
+++ uspace/drv/bus/usb/uhcirh/port.c	(revision a861ccb34a0bd1b6e65c69b2e9b5ccd1bb368aac)
@@ -269,8 +269,22 @@
 	int ret, count = MAX_ERROR_COUNT;
 	do {
-		ret = usb_hc_new_device_wrapper(port->rh, &port->hc_connection,
+		port->attached_device.fun = ddf_fun_create(port->rh, fun_inner,
+		    NULL);
+		if (port->attached_device.fun == NULL) {
+			ret = ENOMEM;
+			continue;
+		}
+
+		ret = usb_hc_new_device_wrapper(port->rh,
+		    port->attached_device.fun,
+		    &port->hc_connection,
 		    speed, uhci_port_reset_enable, port,
-		    &port->attached_device.address, NULL, NULL,
-		    &port->attached_device.fun);
+		    &port->attached_device.address, NULL);
+
+		if (ret != EOK) {
+			ddf_fun_destroy(port->attached_device.fun);
+			port->attached_device.fun = NULL;
+		}
+
 	} while (ret != EOK && count-- > 0);
 
Index: uspace/drv/bus/usb/usbhub/port.c
===================================================================
--- uspace/drv/bus/usb/usbhub/port.c	(revision b5111c46021cac567ff85e5ffa9f39811311f805)
+++ uspace/drv/bus/usb/usbhub/port.c	(revision a861ccb34a0bd1b6e65c69b2e9b5ccd1bb368aac)
@@ -424,7 +424,12 @@
 	ddf_fun_t *child_fun;
 
+	child_fun = ddf_fun_create(data->hub->usb_device->ddf_dev,
+	    fun_inner, NULL);
+	if (child_fun == NULL)
+		return ENOMEM;
+
 	const int rc = usb_hc_new_device_wrapper(data->hub->usb_device->ddf_dev,
-	    &data->hub->usb_device->hc_conn, data->speed, enable_port_callback,
-	    data->port, &new_address, NULL, NULL, &child_fun);
+	    child_fun, &data->hub->usb_device->hc_conn, data->speed,
+	    enable_port_callback, data->port, &new_address, NULL);
 
 	if (rc == EOK) {
@@ -440,4 +445,5 @@
 		    ddf_fun_get_handle(child_fun));
 	} else {
+		ddf_fun_destroy(child_fun);
 		usb_log_error("Failed registering device on port %zu: %s.\n",
 		    data->port->port_number, str_error(rc));
Index: uspace/drv/bus/usb/vhc/hub.c
===================================================================
--- uspace/drv/bus/usb/vhc/hub.c	(revision b5111c46021cac567ff85e5ffa9f39811311f805)
+++ uspace/drv/bus/usb/vhc/hub.c	(revision a861ccb34a0bd1b6e65c69b2e9b5ccd1bb368aac)
@@ -114,9 +114,19 @@
 
 	ddf_fun_t *hub_dev;
-	rc = usb_hc_new_device_wrapper(ddf_fun_get_dev(hc_dev), &hc_conn, USB_SPEED_FULL,
-	    pretend_port_rest, NULL, NULL, &rh_ops, hc_dev, &hub_dev);
+
+	hub_dev = ddf_fun_create(ddf_fun_get_dev(hc_dev), fun_inner, NULL);
+	if (hub_dev == NULL) {
+		rc = ENOMEM;
+		usb_log_fatal("Failed to create root hub: %s.\n",
+		    str_error(rc));
+		return rc;
+	}
+
+	rc = usb_hc_new_device_wrapper(ddf_fun_get_dev(hc_dev), hub_dev,
+	    &hc_conn, USB_SPEED_FULL, pretend_port_rest, NULL, NULL, &rh_ops);
 	if (rc != EOK) {
 		usb_log_fatal("Failed to create root hub: %s.\n",
 		    str_error(rc));
+		ddf_fun_destroy(hub_dev);
 	}
 
