From 55d02c0550b4111624c98d68ef53f0a33803cb2d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 8 Aug 2025 22:42:56 -0400 Subject: kernel: xhci: Fix off-by-one bug The DCBAA has indexing that starts at zero so 1 must be added to make it correct. Signed-off-by: Ian Moffett --- sys/dev/usb/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 0ccb7a0..f18e1a9 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -221,7 +221,7 @@ xhci_alloc_dcbaa(struct xhci_hc *hc) { size_t size; - size = sizeof(uintptr_t) * hc->maxslots; + size = sizeof(uintptr_t) * (hc->maxslots + 1); hc->dcbaap = dynalloc_memalign(size, 0x1000); __assert(hc->dcbaap != NULL); return VIRT_TO_PHYS(hc->dcbaap); -- cgit v1.2.3