Patchwork [29/31] usb-redir: Use reject rather the disconnect on bad ep info

login
register
mail settings
Submitter Gerd Hoffmann
Date Nov. 1, 2012, 3:54 p.m.
Message ID <1351785284-15384-30-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/196319/
State New
Headers show

Comments

Gerd Hoffmann - Nov. 1, 2012, 3:54 p.m.
From: Hans de Goede <hdegoede@redhat.com>

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>
---
 hw/usb/redirect.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index a3df757..5c2d185 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;
         }
     }