diff options
author | 2014-11-09 14:03:04 +0000 | |
---|---|---|
committer | 2014-11-09 14:03:04 +0000 | |
commit | aa87025ff144d3b49e5af9cc46a71f6e608ab532 (patch) | |
tree | ea1d5bcbf56a1b0d9416d90cfc2389bd6769d2dc /sys | |
parent | remove commented entries for tedu'd bluetooth drivers (diff) | |
download | wireguard-openbsd-aa87025ff144d3b49e5af9cc46a71f6e608ab532.tar.xz wireguard-openbsd-aa87025ff144d3b49e5af9cc46a71f6e608ab532.zip |
When a pipe is closed, clear the memory of the corresponding enpoint
context, not the whole array of endpoints. Yeah, pointers are hard.
Fix a panic reported by Dimitris Papastamos on tech@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/xhci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index e2e3ef466d1..ca9785620e1 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.36 2014/11/07 16:33:02 mpi Exp $ */ +/* $OpenBSD: xhci.c,v 1.37 2014/11/09 14:03:04 mpi Exp $ */ /* * Copyright (c) 2014 Martin Pieuchot @@ -1211,7 +1211,7 @@ xhci_pipe_close(struct usbd_pipe *pipe) sdev->slot_ctx->info_lo = htole32(XHCI_SCTX_DCI(lxp->dci)); /* Clear the Endpoint Context */ - memset(&sdev->ep_ctx[xp->dci - 1], 0, sizeof(struct xhci_epctx)); + memset(sdev->ep_ctx[xp->dci - 1], 0, sizeof(struct xhci_epctx)); usb_syncmem(&sdev->ictx_dma, 0, sc->sc_pagesize, BUS_DMASYNC_PREWRITE); |