Because the endpoint index max value is 32, add the index valuecheck in xhci register write function.Signed-off-by: Liu Long <long.liu@...>--- devicemodel/hw/pci/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.cindex b5c1365ce..83fbccc35 100644--- a/devicemodel/hw/pci/xhci.c+++ b/devicemodel/hw/pci/xhci.c@@ -3415,7 +3415,7 @@ pci_xhci_dbregs_write(struct pci_xhci_vdev *xdev, UPRINTF(LDBG, "doorbell write offset 0x%lx: 0x%lx\r\n", offset, value); - if (XHCI_HALTED(xdev)) {+ if (XHCI_HALTED(xdev) || XHCI_DB_TARGET_GET(value) > XHCI_MAX_ENDPOINTS) { UPRINTF(LWRN, "pci_xhci: controller halted\r\n");
return; }-- 2.25.1
© 2023 Groups.io