diff options
-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) { |