aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-10-31 13:47:14 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-11-01 15:21:01 +0100
commit24ac283aa293f9bd8ca4137775506edf33e45eae (patch)
treefd60bf421a6d0efe045c9a760239b1bc1d862f58
parent7e03d1781690c9e9ad67a671237dbcc0d159f528 (diff)
usb-redir: Use reject rather the disconnect on bad ep info
So that the client gets a notification about us disconnecting the device. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--hw/usb/redirect.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index a3df757c43..5c2d185550 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -1353,7 +1353,8 @@ static void usbredir_ep_info(void *priv,
case usb_redir_type_interrupt:
if (dev->endpoint[i].interval == 0) {
ERROR("Received 0 interval for isoc or irq endpoint\n");
- usbredir_device_disconnect(dev);
+ usbredir_reject_device(dev);
+ return;
}
/* Fall through */
case usb_redir_type_control:
@@ -1363,7 +1364,7 @@ static void usbredir_ep_info(void *priv,
break;
default:
ERROR("Received invalid endpoint type\n");
- usbredir_device_disconnect(dev);
+ usbredir_reject_device(dev);
return;
}
}