aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-05-27 14:50:39 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-06-23 11:28:07 +0200
commitbf5547f5365c1bfeba9d5c3e87653b9803a875a5 (patch)
treefca3b2f8acddf45ab38197e35067655c7c575127 /hw
parente4b17767659828cf4057e39b6a4f9d687b2f7cc3 (diff)
usb-bus: Don't allow speed mismatch while attaching devices
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb-bus.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index fc720185b7..2abce12de5 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -200,6 +200,11 @@ static int do_attach(USBDevice *dev)
} else {
port = QTAILQ_FIRST(&bus->free);
}
+ if (!(port->speedmask & dev->speedmask)) {
+ error_report("Warning: speed mismatch trying to attach usb device %s to bus %s\n",
+ dev->product_desc, bus->qbus.name);
+ return -1;
+ }
dev->attached++;
QTAILQ_REMOVE(&bus->free, port, next);