Index: uspace/lib/usbhost/src/bus.c
===================================================================
--- uspace/lib/usbhost/src/bus.c	(revision 92caadde811e80acb043801082ba285f1443ec49)
+++ uspace/lib/usbhost/src/bus.c	(revision 5a73a7ef7b1ec09280aa8c1c0035c765b6f85650)
@@ -229,19 +229,19 @@
 int bus_device_online(device_t *dev)
 {
-	int err;
+	int rc;
 	assert(dev);
 
 	fibril_mutex_lock(&dev->guard);
 	if (dev->online) {
-		fibril_mutex_unlock(&dev->guard);
-		return EINVAL;
+		rc = EINVAL;
+		goto err_lock;
 	}
 
 	/* First, tell the HC driver. */
 	const bus_ops_t *ops = BUS_OPS_LOOKUP(dev->bus->ops, device_online);
-	if (ops && (err = ops->device_online(dev))) {
-		usb_log_warning("Host controller refused to make device '%s' online: %s",
-		    ddf_fun_get_name(dev->fun), str_error(err));
-		return err;
+	if (ops && (rc = ops->device_online(dev))) {
+		usb_log_warning("Host controller failed to make device '%s' online: %s",
+		    ddf_fun_get_name(dev->fun), str_error(rc));
+		goto err_lock;
 	}
 
@@ -252,12 +252,17 @@
 	fibril_mutex_unlock(&dev->guard);
 
-	if ((err = ddf_fun_online(dev->fun))) {
+	if ((rc = ddf_fun_online(dev->fun))) {
 		usb_log_warning("Failed to take device '%s' online: %s",
-		    ddf_fun_get_name(dev->fun), str_error(err));
-		return err;
-	}
-
-	usb_log_info("USB Device '%s' offlined.", ddf_fun_get_name(dev->fun));
-	return EOK;
+		    ddf_fun_get_name(dev->fun), str_error(rc));
+		goto err;
+	}
+
+	usb_log_info("USB Device '%s' is now online.", ddf_fun_get_name(dev->fun));
+	return EOK;
+
+err_lock:
+	fibril_mutex_unlock(&dev->guard);
+err:
+	return rc;
 }
 
@@ -267,10 +272,12 @@
 int bus_device_offline(device_t *dev)
 {
-	int err;
+	int rc;
 	assert(dev);
 
 	/* Make sure we're the one who offlines this device */
-	if (!dev->online)
-		return ENOENT;
+	if (!dev->online) {
+		rc = ENOENT;
+		goto err;
+	}
 
 	/*
@@ -281,6 +288,6 @@
 	
 	/* Tear down all drivers working with the device. */
-	if ((err = ddf_fun_offline(dev->fun))) {
-		return err;
+	if ((rc = ddf_fun_offline(dev->fun))) {
+		goto err;
 	}
 
@@ -295,6 +302,9 @@
 
 	fibril_mutex_unlock(&dev->guard);
-	usb_log_info("USB Device '%s' offlined.", ddf_fun_get_name(dev->fun));
-	return EOK;
+	usb_log_info("USB Device '%s' is now offline.", ddf_fun_get_name(dev->fun));
+	return EOK;
+
+err:
+	return rc;
 }
 
