Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111613832
D37118.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
D37118.diff
View Options
diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c
--- a/usr.sbin/bhyve/pci_xhci.c
+++ b/usr.sbin/bhyve/pci_xhci.c
@@ -1183,8 +1183,7 @@
static uint32_t
pci_xhci_find_stream(struct pci_xhci_softc *sc, struct xhci_endp_ctx *ep,
- struct pci_xhci_dev_ep *devep, uint32_t streamid,
- struct xhci_stream_ctx **osctx)
+ struct pci_xhci_dev_ep *devep, uint32_t streamid)
{
struct xhci_stream_ctx *sctx;
@@ -1203,12 +1202,11 @@
if (streamid > devep->ep_MaxPStreams)
return (XHCI_TRB_ERROR_STREAM_TYPE);
- sctx = XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) + streamid;
+ sctx = (struct xhci_stream_ctx *)XHCI_GADDR(sc, ep->qwEpCtx2 & ~0xFUL) +
+ streamid;
if (!XHCI_SCTX_0_SCT_GET(sctx->qwSctx0))
return (XHCI_TRB_ERROR_STREAM_TYPE);
- *osctx = sctx;
-
return (XHCI_TRB_ERROR_SUCCESS);
}
@@ -1263,12 +1261,8 @@
streamid = XHCI_TRB_2_STREAM_GET(trb->dwTrb2);
if (devep->ep_MaxPStreams > 0) {
- struct xhci_stream_ctx *sctx;
-
- sctx = NULL;
- cmderr = pci_xhci_find_stream(sc, ep_ctx, devep, streamid,
- &sctx);
- if (sctx != NULL) {
+ cmderr = pci_xhci_find_stream(sc, ep_ctx, devep, streamid);
+ if (cmderr == XHCI_TRB_ERROR_SUCCESS) {
assert(devep->ep_sctx != NULL);
devep->ep_sctx[streamid].qwSctx0 = trb->qwTrb0;
@@ -1910,6 +1904,7 @@
struct xhci_trb *trb;
uint64_t ringaddr;
uint32_t ccs;
+ int error;
DPRINTF(("pci_xhci doorbell slot %u epid %u stream %u",
slot, epid, streamid));
@@ -1949,8 +1944,6 @@
/* get next trb work item */
if (devep->ep_MaxPStreams != 0) {
- struct xhci_stream_ctx *sctx;
-
/*
* Stream IDs of 0, 65535 (any stream), and 65534
* (prime) are invalid.
@@ -1960,10 +1953,10 @@
return;
}
- sctx = NULL;
- pci_xhci_find_stream(sc, ep_ctx, devep, streamid, &sctx);
- if (sctx == NULL) {
- DPRINTF(("pci_xhci: invalid stream %u", streamid));
+ error = pci_xhci_find_stream(sc, ep_ctx, devep, streamid);
+ if (error != XHCI_TRB_ERROR_SUCCESS) {
+ DPRINTF(("pci_xhci: invalid stream %u: %d",
+ streamid, error));
return;
}
sctx_tr = &devep->ep_sctx_trbs[streamid];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 7, 12:52 AM (16 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17022550
Default Alt Text
D37118.diff (2 KB)
Attached To
Mode
D37118: bhyve: Fix an apparent pointer arithmetic bug in the xhci emulation
Attached
Detach File
Event Timeline
Log In to Comment