memcpy(&gUSBEnqueuedEHCI[gUSBEnqueuedEHCICount++], pci_dev, sizeof(pci_dt_t));gUSBEnqueuedEHCI is hardcoded to a size of MAX_USB_DEVICES * sizeof(pci_dt_t), so if you ever have a machine with more than MAX_USB_DEVICES controllers, you're writing to memory that you shouldn't be. The same goes for the other pci_dt_t array.