Index: uspace/lib/usbdev/src/devdrv.c
===================================================================
--- uspace/lib/usbdev/src/devdrv.c	(revision 6883abfa0e2bb564d2da375c57df0a6dab5b9297)
+++ uspace/lib/usbdev/src/devdrv.c	(revision 441633f64c76acf9273ef15a0396d28c12edf29c)
@@ -107,19 +107,17 @@
 	}
 
-	usb_endpoint_mapping_t *pipes;
-	size_t pipes_count;
-
-	int rc = usb_device_create_pipes(&dev->wire, endpoints,
+	usb_endpoint_mapping_t *pipes = NULL;
+	size_t pipes_count = 0;
+
+	const int rc = usb_device_create_pipes(&dev->wire, endpoints,
 	    dev->descriptors.configuration, dev->descriptors.configuration_size,
 	    dev->interface_no, alternate_setting, &pipes, &pipes_count);
 
-	if (rc != EOK) {
-		return rc;
-	}
-
-	dev->pipes = pipes;
-	dev->pipes_count = pipes_count;
-
-	return EOK;
+	if (rc == EOK) {
+		dev->pipes = pipes;
+		dev->pipes_count = pipes_count;
+	}
+
+	return rc;
 }
 /*----------------------------------------------------------------------------*/
@@ -238,11 +236,9 @@
 	}
 
-	int rc;
-
 	/* Destroy existing pipes. */
 	destroy_current_pipes(dev);
 
 	/* Change the interface itself. */
-	rc = usb_request_set_interface(&dev->ctrl_pipe, dev->interface_no,
+	int rc = usb_request_set_interface(&dev->ctrl_pipe, dev->interface_no,
 	    alternate_setting);
 	if (rc != EOK) {
@@ -309,5 +305,4 @@
  * - registers endpoints with the host controller
  *
- * @param[in] dev Generic DDF device backing the USB one.
  * @param[in] wire Initialized backing connection to the host controller.
  * @param[in] endpoints Endpoints description, NULL terminated.
@@ -351,5 +346,5 @@
 	}
 
-	/* Now allocate and fully initialize. */
+	/* Now initialize. */
 	for (i = 0; i < pipe_count; i++) {
 		pipes[i].description = endpoints[i];
@@ -362,7 +357,9 @@
 	    config_descr, config_descr_size, wire);
 	if (rc != EOK) {
-		goto rollback_free_only;
-	}
-
+		free(pipes);
+		return rc;
+	}
+
+	/* Register created pipes. */
 	for (i = 0; i < pipe_count; i++) {
 		if (pipes[i].present) {
@@ -395,12 +392,5 @@
 	}
 
-	/*
-	 * Jump here if something went wrong before some actual communication
-	 * with HC. Then the only thing that needs to be done is to free
-	 * allocated memory.
-	 */
-rollback_free_only:
 	free(pipes);
-
 	return rc;
 }
@@ -408,5 +398,4 @@
 /** Destroy pipes previously created by usb_device_create_pipes.
  *
- * @param[in] dev Generic DDF device backing the USB one.
  * @param[in] pipes Endpoint mapping to be destroyed.
  * @param[in] pipes_count Number of endpoints.
