projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
adddecb
)
usb-bus: Don't allow attaching a device to a bus with no free ports
author
Hans de Goede
<hdegoede@redhat.com>
Fri, 27 May 2011 12:46:27 +0000
(14:46 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Thu, 23 Jun 2011 09:28:06 +0000
(11:28 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-bus.c
patch
|
blob
|
history
diff --git
a/hw/usb-bus.c
b/hw/usb-bus.c
index 480956dfcf0aecd7f91a4394c50d21721dda6f7c..0a49921c0caf087543b29970797eefa95f4eda09 100644
(file)
--- a/
hw/usb-bus.c
+++ b/
hw/usb-bus.c
@@
-181,6
+181,11
@@
static void do_attach(USBDevice *dev)
dev->product_desc);
return;
}
+ if (bus->nfree == 0) {
+ fprintf(stderr, "Warning: tried to attach usb device %s to a bus with no free ports\n",
+ dev->product_desc);
+ return;
+ }
if (dev->port_path) {
QTAILQ_FOREACH(port, &bus->free, next) {
if (strcmp(port->path, dev->port_path) == 0) {