usb-bus: Don't allow speed mismatch while attaching devices

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Hans de Goede 2011-05-27 14:50:39 +02:00 committed by Gerd Hoffmann
parent e4b1776765
commit bf5547f536
1 changed files with 5 additions and 0 deletions

View File

@ -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);