mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
usb-hub: need to check dev->attached
commit 891fb2cd45
did that for all host
controllers, the usb hub was left out by accident.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
d3ac1a87b2
commit
3393bc105d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user