diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-12 12:44:58 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-12 13:01:58 -0400 |
commit | a39d7ebfd504110ab3e84fa3990bd79f7ba2271f (patch) | |
tree | baf67750de511708584e613c12854cd59bc92ae3 /src/sys/io/usb | |
parent | 4ca8c6169f1e7419aa39b97345b732c91119e353 (diff) |
kern: xhci: Add NULL check to xhci_init_dcbaap()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/io/usb')
-rw-r--r-- | src/sys/io/usb/hcd/xhci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sys/io/usb/hcd/xhci.c b/src/sys/io/usb/hcd/xhci.c index 0300367..e5a794a 100644 --- a/src/sys/io/usb/hcd/xhci.c +++ b/src/sys/io/usb/hcd/xhci.c @@ -150,6 +150,10 @@ xhci_init_dcbaap(struct xhci_hcd *hcd) uint32_t npages; void *va; + if (hcd == NULL) { + return -EINVAL; + } + npages = BYTES_TO_PAGES(hcd->max_slots * XHCI_CTX_SIZE); hcd->dcbaap_pa = vm_alloc_frame(npages); if (hcd->dcbaap_pa == 0) { |