summaryrefslogtreecommitdiffstats
path: root/src/channel-usbredir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/channel-usbredir.c')
-rw-r--r--src/channel-usbredir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index d04267f..dc96d09 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -296,12 +296,12 @@ static void spice_usbredir_channel_open_acl_cb(
spice_usbredir_channel_open_device(channel, &err);
}
if (err) {
- g_task_return_error(priv->task, err);
libusb_unref_device(priv->device);
priv->device = NULL;
g_boxed_free(spice_usb_device_get_type(), priv->spice_device);
priv->spice_device = NULL;
priv->state = STATE_DISCONNECTED;
+ g_task_return_error(priv->task, err);
} else {
g_task_return_boolean(priv->task, TRUE);
}