From e460f7ea7913ce1363f15bc784f7d6817acd8a96 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 8 Aug 2025 22:46:35 -0400 Subject: kernel: xhci: Fix zeroing of NULL page Signed-off-by: Ian Moffett --- sys/dev/usb/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 89d1b17..b429ac5 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -200,12 +200,12 @@ xhci_init_scratchpads(struct xhci_hc *hc) for (size_t i = 0; i < max_bufs; ++i) { tmp = vm_alloc_frame(1); - memset(PHYS_TO_VIRT(tmp), 0, 0x1000); if (tmp == 0) { /* TODO: Shutdown, free memory */ pr_error("failed to fill scratchpad buffer array\n"); return -1; } + memset(PHYS_TO_VIRT(tmp), 0, 0x1000); bufarr[i] = tmp; } -- cgit v1.2.3