Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133228683
D25228.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D25228.diff
View Options
Index: head/usr.sbin/bhyve/pci_xhci.c
===================================================================
--- head/usr.sbin/bhyve/pci_xhci.c
+++ head/usr.sbin/bhyve/pci_xhci.c
@@ -1843,6 +1843,9 @@
DPRINTF(("pci_xhci[%d]: xfer->ndata %u", __LINE__, xfer->ndata));
+ if (xfer->ndata <= 0)
+ goto errout;
+
if (epid == 1) {
err = USB_ERR_NOT_STARTED;
if (dev->dev_ue->ue_request != NULL)
@@ -1857,6 +1860,7 @@
err = USB_TO_XHCI_ERR(err);
if ((err == XHCI_TRB_ERROR_SUCCESS) ||
+ (err == XHCI_TRB_ERROR_STALL) ||
(err == XHCI_TRB_ERROR_SHORT_PKT)) {
err = pci_xhci_xfer_complete(sc, xfer, slot, epid, &do_intr);
if (err != XHCI_TRB_ERROR_SUCCESS)
Index: head/usr.sbin/bhyve/usb_mouse.c
===================================================================
--- head/usr.sbin/bhyve/usb_mouse.c
+++ head/usr.sbin/bhyve/usb_mouse.c
@@ -390,7 +390,7 @@
"sizeof(umouse_dev_desc) %lu",
len, sizeof(umouse_dev_desc)));
if ((value & 0xFF) != 0) {
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
}
if (len > sizeof(umouse_dev_desc)) {
@@ -405,7 +405,7 @@
case UDESC_CONFIG:
DPRINTF(("umouse: (->UDESC_CONFIG)"));
if ((value & 0xFF) != 0) {
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
}
if (len > sizeof(umouse_confd)) {
@@ -474,7 +474,7 @@
default:
DPRINTF(("umouse: unknown(%d)->ERROR", value >> 8));
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
}
eshort = data->blen > 0;
@@ -498,7 +498,7 @@
break;
default:
DPRINTF(("umouse: IO ERROR"));
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
}
eshort = data->blen > 0;
@@ -509,7 +509,7 @@
if (index != 0) {
DPRINTF(("umouse get_interface, invalid index %d",
index));
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
}
@@ -580,7 +580,7 @@
case UREQ(UR_SET_FEATURE, UT_WRITE_INTERFACE):
case UREQ(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
DPRINTF(("umouse: (UR_CLEAR_FEATURE, UT_WRITE_INTERFACE)"));
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
case UREQ(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
@@ -619,7 +619,7 @@
memcpy(data->buf, &sc->um_report, len);
data->bdone += len;
} else {
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
goto done;
}
eshort = data->blen > 0;
@@ -661,7 +661,7 @@
default:
DPRINTF(("**** umouse request unhandled"));
- err = USB_ERR_IOERROR;
+ err = USB_ERR_STALLED;
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 25, 3:52 AM (1 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24158953
Default Alt Text
D25228.diff (2 KB)
Attached To
Mode
D25228: Prevent calling USB backends multiple times.
Attached
Detach File
Event Timeline
Log In to Comment