mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-14 15:44:33 +00:00
DM: Add endpoint index value check in doorbell write
Check max ep index in doorbell write function to avoid overwriting the pci_xhci_dev_emu->eps[XHCI_MAX_ENDPOINTS]. Tracked-On: #7759 Signed-off-by: Liu Long <long.liu@linux.intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
parent
5890b90fea
commit
7efb86afb1
@ -3419,6 +3419,11 @@ pci_xhci_dbregs_write(struct pci_xhci_vdev *xdev,
|
|||||||
UPRINTF(LWRN, "pci_xhci: controller halted\r\n");
|
UPRINTF(LWRN, "pci_xhci: controller halted\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (XHCI_DB_TARGET_GET(value) > XHCI_MAX_ENDPOINTS) {
|
||||||
|
UPRINTF(LWRN, "pci_xhci: invalid doorbell target %d!\n",
|
||||||
|
XHCI_DB_TARGET_GET(value));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (offset == 0)
|
if (offset == 0)
|
||||||
pci_xhci_complete_commands(xdev);
|
pci_xhci_complete_commands(xdev);
|
||||||
|
Loading…
Reference in New Issue
Block a user