summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-12-03 13:38:08 +0100
committerHans de Goede <hdegoede@redhat.com>2012-12-05 00:39:09 +0100
commitb7388d9a26837d94041b798c4a98825cc0448ea7 (patch)
tree658879c8574f93c28dc2799dfc711e044515c095
parentbac505aabbd45eb7d45466ab778a8386d860cbe4 (diff)
usbredirhost_submit_stream_transfer_unlocked: Handle device disconnect
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--usbredirhost/usbredirhost.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index 2663d6a..9664b75 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -886,9 +886,13 @@ static int usbredirhost_submit_stream_transfer_unlocked(
r = libusb_submit_transfer(transfer->transfer);
if (r < 0) {
uint8_t ep = transfer->transfer->endpoint;
- ERROR("error submitting transfer on ep %02X: %s, stopping stream",
- ep, libusb_error_name(r));
- usbredirhost_cancel_stream_unlocked(host, ep);
+ if (r == LIBUSB_ERROR_NO_DEVICE) {
+ usbredirhost_handle_disconnect(host);
+ } else {
+ ERROR("error submitting transfer on ep %02X: %s, stopping stream",
+ ep, libusb_error_name(r));
+ usbredirhost_cancel_stream_unlocked(host, ep);
+ }
return usb_redir_stall;
}