aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-09-15 09:20:02 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-10-13 12:58:51 +0200
commit3393bc105d58e1f4a27d9a8e7062da9cef260cc3 (patch)
treefaeada2e292018334aefe97f64a341719c003d98 /hw
parentd3ac1a87b228bcd231d19acf1ebe9844b7639237 (diff)
downloadqemu-3393bc105d58e1f4a27d9a8e7062da9cef260cc3.zip
qemu-3393bc105d58e1f4a27d9a8e7062da9cef260cc3.tar.gz
qemu-3393bc105d58e1f4a27d9a8e7062da9cef260cc3.tar.bz2
usb-hub: need to check dev->attached
commit 891fb2cd4592b6fe76106a69e0ca40efbf82726a did that for all host controllers, the usb hub was left out by accident. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb-hub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb-hub.c b/hw/usb-hub.c
index 286e3ad..39382c7 100644
--- a/hw/usb-hub.c
+++ b/hw/usb-hub.c
@@ -289,7 +289,7 @@ static int usb_hub_handle_control(USBDevice *dev, USBPacket *p,
port->wPortStatus |= PORT_STAT_SUSPEND;
break;
case PORT_RESET:
- if (dev) {
+ if (dev && dev->attached) {
usb_send_msg(dev, USB_MSG_RESET);
port->wPortChange |= PORT_STAT_C_RESET;
/* set enable bit */
@@ -429,7 +429,7 @@ static int usb_hub_broadcast_packet(USBHubState *s, USBPacket *p)
for(i = 0; i < NUM_PORTS; i++) {
port = &s->ports[i];
dev = port->port.dev;
- if (dev && (port->wPortStatus & PORT_STAT_ENABLE)) {
+ if (dev && dev->attached && (port->wPortStatus & PORT_STAT_ENABLE)) {
ret = usb_handle_packet(dev, p);
if (ret != USB_RET_NODEV) {
return ret;